What is diffrence between print() and println() ?
Both Method are used to display the result on the monitor .print() method displlay the result and then retains the cursor in the same line , next to the end of the result .println() method display the result the cursor to the next line.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Aug 24, 2012, 5:06 AM EDT
where as print prints on the same line.
Eg:
System.out.print( "test");
System.out.print( "test");
The out put will be "testtest" in same line
But if you println
System.out.println( "test");
System.out.println( "test");
the out put will be in 2 lines
test
test
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 24, 2012, 9:13 AM EDT