This is my code. Please tell me what I'm doing wrong.

public class Solution
{
    public static void main(String[] args)
    {
        String s = "Many people are alive only because it’s illegal to shoot them.";
    System.out.println(s);
    System.out.println(s);
    System.out.println(s);
    }
}

asked 05 Jun '15, 11:25

Osama%20Arshad's gravatar image

Osama Arshad
1
accept rate: 0%


Hey, You're missing a newline, try this:

String s="Many people are alive only because it's illegal\nto shoot them.";

\n is a new line character

link

answered 14 Jul, 15:58

NEuROnek's gravatar image

NEuROnek
11
accept rate: 0%

edited 14 Jul, 16:00

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×2
×1

Asked: 05 Jun '15, 11:25

Seen: 744 times

Last updated: 14 Jul, 16:00