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: 10036
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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests