This is my code. I'm printing the line seven times but it is not validating the output.

public class Solution
{
    public static void main(String[] args)
    {
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
        System.out.print("It’s kind of fun to do the impossible. ");
    }
}

asked 05 Jun '15, 11:13

Osama%20Arshad's gravatar image

Osama Arshad
1
accept rate: 0%


Remove the space at the end of each statement after the full stop.

link

answered 07 Jun '15, 08:30

Vivek's gravatar image

Vivek
111
accept rate: 0%

And also change ’ to ' and System.out.print to System.out.println (at least in first six lines). Now it should work fine.

link

answered 13 Aug, 17:40

pwwl's gravatar image

pwwl
11
accept rate: 0%

edited 13 Aug, 17:41

Why dont work?

public class Solution

{ public static void main(String[] args)

{
   String s="It's kind of fun to do the impossible.";
    print3Time(s);
    print4Time(s);

}

public static void print3Time(String=s)
{
System.out.println(s);
System.out.println(s);
System.out.println(s);
}

 public static void print4Time(String=s)
{
System.out.println(s);
System.out.println(s);
System.out.println(s);
System.out.println(s);
}

}

link

answered 01 Dec, 04:29

zhuk's gravatar image

zhuk
11
accept rate: 0%

edited 01 Dec, 04:33

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

Asked: 05 Jun '15, 11:13

Seen: 778 times

Last updated: 01 Dec, 04:33

Related questions