Page 1 of 1

About Questions enthuware.ocpjp.v17.2.3684, 3685, 3690

Posted: Sat Nov 05, 2022 7:34 am
by theujior
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.

Re: About Questions enthuware.ocpjp.v17.2.3684, 3685, 3690

Posted: Sat Nov 05, 2022 11:17 pm
by admin
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!