About Question enthuware.ocpjp.ii.v11.2.3501 :
Moderator: admin
-
- Posts: 1
- Joined: Mon Aug 05, 2019 3:47 pm
- Contact:
About Question enthuware.ocpjp.ii.v11.2.3501 :
In the first option, the interface is not a functional interface and because of the exitance of @FunctionalInterface on it, the compilation will fail.
-
- Site Admin
- Posts: 10064
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3501 :
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.
-
- Posts: 1
- Joined: Sat Apr 17, 2021 7:07 am
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3501 :
The explanation correctly states that interface A is invalid.
Following that, why is AA a valid option?
Following that, why is AA a valid option?
-
- Site Admin
- Posts: 10064
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.3501 :
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.
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.
Who is online
Users browsing this forum: No registered users and 91 guests