"Hi, it's me again. I'll give you three lessons today. And this is the second one! Make yourself comfortable and listen up. I'm going to tell you about displaying text on the screen. It's actually very simple:"

Java code What will be displayed on the screen
System.out.println("Diego");
System.out.println(3);
System.out.println("Rain" + "In" + "Spain");
Diego
3
RainInSpain
System.out.println(1 + 3);
System.out.println("1" + "3");
System.out.println(1 + "3");
System.out.println("1" + 3);
System.out.println("1" + (1 + 3));
4
13
13
13
14
System.out.println("Amigo is the best!");
System.out.println("Amigo" + "is the best!");
System.out.println("Amigo" + " " + "is the best!");
Amigo is the best!
Amigois the best!
Amigo is the best!
System.out.println(3 * 3 + 4 * 4);
System.out.println(1 * 2 + 3 * 4);
25
14
System.out.print("Diego");
System.out.print("Diego");
System.out.print("Diego");
DiegoDiegoDiego
System.out.print("Diego ");
System.out.println("is the best!");
System.out.print("Amigo ");
System.out.println("is the best!");
Diego is the best!
Amigo is the best!
undefined
1
Task
New Java Syntax, level 1, lesson 7
Locked
Nerd break
The super secret CodeGym training center has both standard lessons and entertaining lessons. But we don't have them just for the sake of having them. They will teach you loads about your future field of employment! It's time to relax a bit and watch a video about your future colleagues.

"Could you tell me about print() and println() one more time?"

"The print(), function is used to display text on the screen, character by character. When the screen no longer has room on a line, the text begins to be displayed on the next line. You can use the println() function to stop displaying text on the current line even before it is full. Subsequent text will appear on the next line."

"OK. And what was that trick with adding numbers and strings?"

"If you add two numbers, the result is also a number: 2+2 equals 4. If you add a number and a string, the number is converted to a string. Then the two strings are simply joined together."

"Oh! That's what I thought from looking at the examples, but who knows. Thank you for this interesting lesson, Ellie."

"You're welcome. And finally, here are a few tasks from Diego. He wanted me to check your progress."