Can somebody explain me why this code does not print the numbers?
String text = new String("SomeString"); for (int i=0; i<1500; i++)
To do the same more efficiently
StringBuilder text = new StringBuilder("SomeString"); for (int i = 0; i < 1500; i++) { text.append(i); } System.out.println(text);
Both examples work for me on Java 6 update 32 and Java 7 update 3.