Semicolon is missing
About Question enthuware.ocajp.i.v8. 2 . 1466 :
Moderators: Site Manager, fjwalraven
-
- Posts: 32
- Joined: Fri Oct 16, 2015 4:33 am
- Contact:
About Question enthuware.ocajp.i.v8. 2 . 1466 :
Last edited by admin on Wed Oct 21, 2015 12:17 am, edited 1 time in total.
Reason: updated qid
Reason: updated qid
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1466 :
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.
-
- Posts: 32
- Joined: Fri Oct 16, 2015 4:33 am
- Contact:
Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :
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:
It would be good that it is written:
"Notice the lack of curly brackets, return keyword and the semicolon".
Code: Select all
printImportantData(al, (Data d)->{ return d.value>1 } ); // DOES NOT COMPILE
"Notice the lack of curly brackets, return keyword and the semicolon".
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :
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.
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.
-
- Posts: 32
- Joined: Fri Oct 16, 2015 4:33 am
- Contact:
Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :
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
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8. 2 . 1466 :
Ok, updated.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 18 guests