Home arrow static arrow Java Programming [Archive] - println
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - println
This topic has 3 replies on 1 page.

Posts:1,367
Registered: 1/5/04
println  
Jun 15, 2004 12:35 AM



 
how to create two line using one call to System.out.println() ? is it possible ? println does not accept \n inside as argument. so any way ?
 

Posts:833
Registered: 1/2/04
Re: println  
Jun 15, 2004 12:38 AM (reply 1 of 3)



 
For me, it works. I just use this

System.out.println("This is the \n Test");
 

Posts:236
Registered: 5/11/04
Re: println  
Jun 15, 2004 12:38 AM (reply 2 of 3)



 
what about something like this?

System.out.println("line 1" + '\n' + "line 2" + '\n');
 

Posts:951
Registered: 6/7/01
Re: println  
Jun 15, 2004 12:39 AM (reply 3 of 3)



 
What's wrong with System.out.println("Line 1\nLine2") ?
 
This topic has 3 replies on 1 page.