posted 19 years ago
The key to this problem is that there must be one statement between do and while(...);
In the first, there is no statement.
in the second case, there is one print statement.
In the third case, "while(true);" is treated as a while loop with an empty statement as the body, so "while(true);" is the one statement and "while(false);" is the rest of the do statement.
Mike Gershman
SCJP 1.4, SCWCD in process