[ad_1]
The first one won’t have any output since the stdout stream wasn’t flushed by a newline (or a manual call).
In Java, the method called is println, so it’s adding a newline at the end of the string, causing the stream to flush.
[ad_2]
solved What output of the both program is different?