Java – Debug with System.out.print in a loop (Eclipse)


To my surprise in the following program the Eclipse console doesn't print while in the loop.
It prints only: "start: finish".
When I use println instead it does.
Of when I remove the comment it does too.
Surprise: when I copy the lines "start: finish" in the console, the clipboard does contain all printed numbers.
Interesting to know waht is the cause of this behaviour?

public static void main(String[] args) {
        System.out.print("start: ");
        for (int i = 0; i < 10000; i++) {
            // if (i > 1000 && i < 1010)
                System.out.print(i + " ");

Best Solution

Well, you have a very, very long line there. So, it is quite possible that you have exceeded the maximum line length that the Eclipse console can reliably display. The content probably has been printed there (as evidenced by the fact that it appeared in your clipboard when you copy and paste) but doesn't render well.