Pay attention on this one:
public class TestClass {
public static void main(String[] args){
int k = 2;
do{
System.out.println(k);
}while(--k>0)
}
}
note that the while statement does not end with a semicolon and the program says that the answer is 2 1.
Correct if I am wrong, but isn't it a little confusing, I mean you don't know if you must consider that an semicolon is misplaced or that it doen't exists at all
About Question enthuware.ocajp.i.v7.2.848 :
Moderators: Site Manager, fjwalraven
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.848 :
You are right. There is should be a semicolon at the end. Thanks for reporting this. Will be fixed asap.
HTH,
Paul.
HTH,
Paul.
Who is online
Users browsing this forum: Bing [Bot] and 16 guests