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,

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete