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

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

Moderator: admin

Post Reply
theujior
Posts: 12
Joined: Fri Sep 09, 2022 8:41 am
Contact:

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

Post 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.

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

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

Post 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!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 51 guests