About Question enthuware.ocpjp.ii.v11.2.3501 :

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

Moderator: admin

Post Reply
huangfeng212
Posts: 1
Joined: Mon Aug 05, 2019 3:47 pm
Contact:

About Question enthuware.ocpjp.ii.v11.2.3501 :

Post by huangfeng212 »

In the first option, the interface is not a functional interface and because of the exitance of @FunctionalInterface on it, the compilation will fail.

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

Re: About Question enthuware.ocpjp.ii.v11.2.3501 :

Post by admin »

Correct, that is why it is not a correct option. The explanation below this option says the same.
If you like our products and services, please help us by posting your review here.

gcamaraomarques
Posts: 1
Joined: Sat Apr 17, 2021 7:07 am
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3501 :

Post by gcamaraomarques »

The explanation correctly states that interface A is invalid.

Following that, why is AA a valid option?

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

Re: About Question enthuware.ocpjp.ii.v11.2.3501 :

Post by admin »

The explanation already explains this:
Although there is no @FunctionalInterface annotation on this interface, it has exactly one abstract method and is, therefore, a valid functional interface.

and also says at the end:

It is not necessary to apply the @FunctionalInterface annotation to a functional interface but it is recommended to do so because doing so enables IDEs and compilers to generate error message if the interface does not satisfy the requirements of functional interface.
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 57 guests