View Single Post
Old 05-19-2012, 03:46 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
println is equivalent to using System.out.print(whateverdata + '\n') or System.out.print(whateverdata + "\n"). Java considers \n as a valid linefeed either inline with double quotes similar to C printf, or with single quotes denoting it as a char and not a string. When provided with no data, or data that is empty, it will print only a linefeed.
So:
Code:
System.out.println();
System.out.print('\n');
System.out.print("\n");
Would print three empty lines.
Fou-Lu is offline   Reply With Quote