askIT

Java Print (System.out.println)

The function System.out.println(""); is used to print text in Java. Between the quotes you can write a text you want to appear in the program. See example below.

System.out.println("This text will appear on screen.");

Output:
This text will appear on screen.

Printing multiple lines

Add \n to get mulible lines in your code. You need to add \n between your text to get line shift. All text need to be inside quotations.

System.out.println("This text will appear on the screen.\nIt will span multiple lines.");

Output:
This text will appear on the screen.
It will span multiple lines.

Add comment

avatar_blank_60.png

Comment:

Name:

Email:

Comments

No comments yet. You can be the first one to comment. Just write your comment in the form and click on the submit button.