2010년 5월 27일 목요일

In Java, what is the difference between print and println?

println prints on a new line, where as print prints on the same line.
For example, in your program you use "print" to print the word "Detroit" and then you use "print" again to print "smells" the output would be:

 
Detroitsmells

 
If you use "print" to print "Detroit" and then you use "println" to print "smells" your output would be:

 
Detroit
smells

댓글 없음:

댓글 쓰기