Remove comments from part of the code so that "Happy New Year" appears on the screen.
Uh... Happy New Year!
- 1
Locked
Comments (8)
- Popular
- New
- Old
You must be signed in to leave a comment
The OG
21 March, 19:36
im so confused on how to do this at all
0
javist Android Developer
24 February, 17:27
make all tasks like Code Entry tasks for more typing effectiveness
0
Anonymous #10916593
12 January, 00:19
why does .println not put year on a separate line here? I thought it always started a new line when you use .println
0
Roman
17 January, 07:42
Show me the code that you think is wrong.
0
Anonymous #10916593
19 January, 01:33
System.out.print("Happy New");
System.out.print(" ");
System.out.println("Year");
I just seems like it should display "Happy New
Year"
But actually displays "Happy New Year"
0
Roman
21 January, 09:01
I just seems like it should display "Happy New
Year"
Why? System.out.print(" "); System.out.print does not move the cursor to a new line
0
Anonymous #10916593
24 January, 23:29
I guess my reasoning is System.out.println() starts a new line right? so in the case of
System.out.println("happy");
System.out.print(" new");
System.out.println("year");
you would get:
Happy new
year
right?
Does my reasoning make sense? I'm guessing this is a technicality if .print is used before any instance of .println.
0
John Squirrels Website Admin at CodeGym
25 January, 07:08
If you use System.out.println, then the subsequent text will appear on the next line.
so in the case of
System.out.println("happy");
System.out.print(" new");
System.out.println("year");
you would get:
Happy new
year
right?
Not exactly. The output would be next:
happy
newyear
0