5th option of enthuware.ocpjp.v17.2.3684 explains:
package days;
sealed class Monday extends WeekDay{ }
A sealed class must have a permits clause.
and 3rd option of enthuware.ocpjp.v17.2.3685 explains:
sealed interface Value extends Cacheable{ }
sealed interface Result extends Cacheable{ }
A sealed interface must have a permits clause.
and 5th option of enthuware.ocpjp.v17.2.3690 explains:
package p1.p2;
public sealed class CompoundIntCalculator extends InterestCalculator{ }
A top level sealed class must have a permits clause.
Also, appropriate import statements are required.
permits clause can be omitted if permitted subclasses/interfaces are declared in the same compilation unit as sealed class/interface.
therefore 3rd option of enthuware.ocpjp.v17.2.3685 and 5th option of enthuware.ocpjp.v17.2.3690 are not incorrect.
About Questions enthuware.ocpjp.v17.2.3684, 3685, 3690
Moderator: admin
-
- Posts: 12
- Joined: Fri Sep 09, 2022 8:41 am
- Contact:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Questions enthuware.ocpjp.v17.2.3684, 3685, 3690
The explanation has been updated to include this point. Although the options are still incorrect because as they are now, they are invalid (will not compile). The presence of another imaginary subclass should not be assumed since no such information is given in the problem statement or option.
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 126 guests