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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ETS User

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

Post 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

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

You are right. There is should be a semicolon at the end. Thanks for reporting this. Will be fixed asap.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 16 guests