Originally Posted by Laserve
Oh my its decided! java is slower!
What do *you* think you're actually testing here? this is nothing more than a I/O system test of 1 java and c++ implementation.
And then, this just shows that you are a mediocre java programmer:
For instance, have you any idea what this line is doing?
System.out.println( i + " is an even number! " );
You're using way more objects and dynamic memory allocations than is necessary. Those not needed 1000 objects may trigger a garbage collection sweep which will of course make you app slower.
Try rewriting it with StringBuffer and Stringbuffer.append and give the results again