레이블이 println인 게시물을 표시합니다. 모든 게시물 표시
레이블이 println인 게시물을 표시합니다. 모든 게시물 표시

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