Following code
System.out.println("Start"); String s = ""; //936 * 5 = 4680 characters for (int i = 0; i < 937; i++){ s += "1234 "; } System.out.println(s); System.out.println("End");
creates an empty line between "Start" and "End" in the java console under the windows, but it works as expected when running MacOS or Linux. The same applies when writing to a file instead of using sysout. I tried several window machines. It doesn't matter if I execute the method through eclipse or via cmd.
When you change "1234" to "1234" or "12g4" or when the number of runs is more / less than 936, it works as expected from the entire OS.
Can someone confirm this / is there a known bug in this question?
source share