About Question enthuware.ocpjp.v17.2.3683 :
Moderator: admin
-
- Posts: 1
- Joined: Sat Jul 16, 2022 1:28 pm
- Contact:
About Question enthuware.ocpjp.v17.2.3683 :
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
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3683 :
You are right. This has now been fixed and an explanation has been added..
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.
-
- Posts: 5
- Joined: Mon Jan 28, 2019 2:00 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3683 :
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.
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.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3683 :
Very true indeed!
Updated again.
Updated again.
If you like our products and services, please help us by posting your review here.
-
- Posts: 11
- Joined: Thu Sep 01, 2022 10:58 am
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3683 :
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.
"public sealed class DocType { }"
as a valid option.
Permits clause is required. Otherwise, it does not compile.
Please, fix it. Thank you.
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3683 :
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.
Who is online
Users browsing this forum: Google [Bot] and 114 guests