About Question enthuware.ocpjp.v11.2.3655 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
syzygy
Posts: 3
Joined: Wed Mar 31, 2021 2:56 pm
Contact:

About Question enthuware.ocpjp.v11.2.3655 :

Post by syzygy »

It should be noted, that the val-- after the inner class is also illegal, so if you just change the inner class to

Code: Select all

public int reduce(int mval) {
    return mval - val;
}
it still fails to compile

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

Re: About Question enthuware.ocpjp.v11.2.3655 :

Post by admin »

Actually, val-- after the inner class is not illegal. Using val inside the inner class if there is val-- after the innerclass is illegal (because val wouldn't remain effectively final if you do val-- after the inner class).
Noted.
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: baichen7788, Bing [Bot] and 3 guests