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

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
Danjel
Posts: 4
Joined: Tue Oct 16, 2012 8:21 am
Contact:

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

Post by Danjel »

Hi

The answer seems a little wrong
if(true) break;
this would work if we are inside a for loop

for(;;){
if(true) break;
}

the answer sais when not inside a switch block, for loops is not mentioned

/Danjel

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

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

Post by admin »

Yes, it is valid in a for loop, but not within an if block (for example). That is why this option is wrong. All other options (except 1) are valid within any context.
If you like our products and services, please help us by posting your review here.

camillabm2
Posts: 1
Joined: Thu Jan 30, 2014 5:50 pm
Contact:

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

Post by camillabm2 »

I'm just wondering... When would I use something like a switch(1)??
I can't think of a situation when it would be useful to use a constant in there.

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

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

Post by admin »

camillabm2 wrote:I'm just wondering... When would I use something like a switch(1)??
I can't think of a situation when it would be useful to use a constant in there.
I can't either. In fact, the compiler may even optimize the code and get rid of such a switch altogether.
-Paul.
If you like our products and services, please help us by posting your review here.

NickWoodward
Posts: 29
Joined: Mon Mar 30, 2015 6:00 pm
Contact:

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

Post by NickWoodward »

admin wrote:Yes, it is valid in a for loop, but not within an if block (for example). That is why this option is wrong. All other options (except 1) are valid within any context.
in my humble opinion, for clarity....

the answer should either emphasise that the question states *when occuring by themselves*

or

it should read "Cannot have break or continue in an 'if' or 'else' block without being inside a loop block"


otherwise it would be very easy imo to walk away from this question thinking that breaks are never allowed in if statments, which is obviously incorrect :)

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

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

Post by admin »

Added.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.

NickWoodward
Posts: 29
Joined: Mon Mar 30, 2015 6:00 pm
Contact:

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

Post by NickWoodward »

admin wrote:Added.
thank you for your feedback!
Paul.
no worries, it's a great piece of software!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests