Showing posts with label newline character. Show all posts
Showing posts with label newline character. Show all posts

Saturday, August 22, 2015

Displaying Multiple Lines Of Text Using Single Print Statement

Hi All...!

Today I'm going to show you how to "Displaying Multiple Lines Of Text Using Single Print Statement ", to do this task we need to use "newline character".

newline character "\n"


newline character use to tell the System.out's print and println methods to when they have to move the cursor to the next line of the command window.

Note


"newline character" is also a white-space character like "blank lines", "space characters" and "tab characters",


Let's see how to use "newline character" in Java program with print method.




Here is the out put,




Now use "newline character" with println method.

Here is the code,


This is the out put,