About Question enthuware.ocpjp.v17.2.3683 :

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

Moderator: admin

Post Reply
elotmanik
Posts: 1
Joined: Sat Jul 16, 2022 1:28 pm
Contact:

About Question enthuware.ocpjp.v17.2.3683 :

Post by elotmanik »

I think the response is not fully correct, some options are though correct. example Option1 is correct, you can declare a sealed class without permits if classes which extend it are in the same java file as the sealed class

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

Re: About Question enthuware.ocpjp.v17.2.3683 :

Post by admin »

You are right. This has now been fixed and an explanation has been added..
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

ftejada
Posts: 5
Joined: Mon Jan 28, 2019 2:00 pm
Contact:

Re: About Question enthuware.ocpjp.v17.2.3683 :

Post by ftejada »

I think we could apply the same assumption to Option 2. Meaning that it could be a valid sealed class declaration too if a subclass were defined in the same Java file.

I guess the question "Identity potentially valid declarations of sealed classes", especially the word "potentially" can lead to different interpretations.

Thanks.
Last edited by ftejada on Wed Jul 20, 2022 1:03 pm, edited 1 time in total.

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

Re: About Question enthuware.ocpjp.v17.2.3683 :

Post by admin »

Very true indeed!
Updated again.
If you like our products and services, please help us by posting your review here.

Val Martinez
Posts: 11
Joined: Thu Sep 01, 2022 10:58 am
Contact:

Re: About Question enthuware.ocpjp.v17.2.3683 :

Post by Val Martinez »

I cannot assume option 2,

"public sealed class DocType { }"

as a valid option.

Permits clause is required. Otherwise, it does not compile.

Please, fix it. Thank you.

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

Re: About Question enthuware.ocpjp.v17.2.3683 :

Post by admin »

permits is not required if the permitted class is in the same file.
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 78 guests