Java TutorialLesson 5Free preview
Java Output
This lesson is part of Java · All levels
Summary
This lesson discusses how to display output to the screen using System.out.print and System.out.println. The main difference is that println adds new lines after text, whereas print does not. In addition to text, you can also print the value of the variable and the result of the expression by connecting it using the plus sign.
Key points
- System.out.println() display the text and move to new line
- System.out.print() displays text without moving lines so that it can be connected in sequence
- To print a variable, write the name directly inside the box without quotation marks.
- The + symbol is used to combine text with other values in one output line
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.