Shervin Asgari Shervin Asgari - 11 days ago 4x
Java Question

do while syntax for java

Ages since I have written a do while.

Whats wrong with this do while

int i = 0;
do {
} while(++i == 500);

I only goes once through the loop, and IMO it should iterate 500 times.


You probably meant

while (++i < 500);

instead of

while (++i == 500);