Console Input and Output
LockedLesson 4 of 60 · Syntax · Easy
Finish these first:Variables and Primitive Types →Or pass the tests below to unlock it now.
The big idea
To display text on screen in Java, programs build a String message and print it with System.out.println(...): You can join pieces of text together with +, and every Java statement ends with a semicolon ;.
Think of it like this: Think of console output like a receipt printer: first you build the text message in a `String`, then `System.out.println(...)` prints it.
Read the lesson
To display text on screen in Java, programs build a String message and print it with System.out.println(...):
String name = "Maya";
String note = "Welcome, " + name;
System.out.println(note);
You can join pieces of text together with +, and every Java statement ends with a semicolon ;.
Quick check
How do you print a line of text to the console in Java?
Your challenge
Inside Solution, create a String variable named message set to "Hello, Ada" (type String message = "Hello, Ada";).
More learning tools(compare languages, visual guide, related lessons)
Compare with another language
Similar to python.input-output (85% overlap). `input()/print()` vs `Scanner`/`System.out`.
Visual walkthrough
A diagram, a step-by-step animation, and short captions for Console Input and Output.
Learn this first
Opens up next
This is the last lesson in this branch.