Remove comments from part of the code so that "Happy New Year" appears on the screen.
Uh... Happy New Year!
- 1
Locked
Comments (10)
- Popular
- New
- Old
You must be signed in to leave a comment
Aarav Chourishi
5 June 2022, 16:26
cant believe you had to uncomment " " i just put a space before year which still should be correct
+1
The OG
21 March 2022, 19:36
im so confused on how to do this at all
+1
javist Android Developer
24 February 2022, 17:27
make all tasks like Code Entry tasks for more typing effectiveness
0
Anonymous #10916593
12 January 2022, 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 2022, 07:42
Show me the code that you think is wrong.
0
Anonymous #10916593
19 January 2022, 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 2022, 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 2022, 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 2022, 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
Manuel Arenas Arce
28 July 2022, 22:16
PrintIn makes it so that the next text that will be displayed would be on another line it doesn't make the code in that printIn appear in another line.
when it said System.out.printIn("year");
it meant that after "year" it would make the next print or printIn be in a separate line it does not make the code be on a separate line, for that to be it would need: System.out.printIn("happy new");
System.out.print("year"); this makes the text say Happy new
year.
In a few words, the printIn method makes the next word appear on the next line.
0