Below is a code I'm having issues with:
public class testOutput {
public static void main(String[] args) throws Exception {
int count = 50000;
String s = "Vinjith";
for(int i=0;i<count;i++) {
System.out.print(s); // change this to println(s); and it works!
System.out.flush();
}
}
}
I'm using Eclipse Galileo - jdk 1.6/ jre6.
- I've set no limit on the console output.
- I've also tried the same program with BufferedWriter: doesn't work
- It works when the variable
count = 584;
not more than that. - I do not get any output when i use System.out.print(s); but when i use System.out.println(s); i get 50000 lines of the string 'Vinjith'.
Thanks.