Page 1 of 1

About Question enthuware.ocajp.i.v7.2.848 :

Posted: Tue Mar 20, 2012 11:12 am
by ETS User
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

Re: About Question enthuware.ocajp.i.v7.2.848 :

Posted: Tue Mar 20, 2012 11:22 am
by admin
You are right. There is should be a semicolon at the end. Thanks for reporting this. Will be fixed asap.

HTH,
Paul.