About Question enthuware.ocajp.i.v8. 2 . 1466 :

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
Mushfiq Mammadov
Posts: 33
Joined: Fri Oct 16, 2015 4:33 am
Contact:

About Question enthuware.ocajp.i.v8. 2 . 1466 :

Post by Mushfiq Mammadov » Tue Oct 20, 2015 11:37 pm

Semicolon is missing
Image
Last edited by admin on Wed Oct 21, 2015 12:17 am, edited 1 time in total.
Reason: updated qid

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

Re: About Question enthuware.ocajp.i.v8.2.1466 :

Post by admin » Wed Oct 21, 2015 12:17 am

Well, the explanation is highlighting only the lack of curly brackets and the return keyword. The next sentence gives you the reason why that is important. I don't see anything wrong with the explanation or the given code.
If you like our products and services, please help us by posting your review here.

Mushfiq Mammadov
Posts: 33
Joined: Fri Oct 16, 2015 4:33 am
Contact:

Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :

Post by Mushfiq Mammadov » Wed Oct 21, 2015 2:28 am

There is no problem in explanation, everything is clear. But according to underlined sentence the code will not compile if we add curly brackets and the return keyword because of semicolon is missing:

Code: Select all

printImportantData(al, (Data d)->{ return d.value>1 } );  // DOES NOT COMPILE
It would be good that it is written:
"Notice the lack of curly brackets, return keyword and the semicolon".

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

Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :

Post by admin » Wed Oct 21, 2015 3:34 am

The sentence is asking you to notice only the two (out of three) changes because it is talking about those two changes in the next sentence.
It does not claim that if you add the two things back it will compile.
Yes, semicolon is missing as well but that is part of the syntax. The statement is trying to explain why the return and curly braces are removed.
If you like our products and services, please help us by posting your review here.

Mushfiq Mammadov
Posts: 33
Joined: Fri Oct 16, 2015 4:33 am
Contact:

Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :

Post by Mushfiq Mammadov » Wed Oct 21, 2015 12:57 pm

It is written that "This can be shortened to:", so in short form curly brackets, return keyword and semicolon are removed. Two of them are noted but semicolon not. I had some mistakes regarding it when I test some questions and therefore I thought that it would be helpful for readers to notice semicolon too. But you are free if you want you may change it or not, I haven't any request regarding it. Just I send feedback for only reminding, because I guess maybe it would be helpful :)

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

Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :

Post by admin » Wed Oct 21, 2015 9:34 pm

Ok, updated.
thank you for your feedback!
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 0 guests