Why the option "Making the Book class extend Document will eliminate all compilation errors." is correct?
1 - "sealed class Document implements Readable permits Book{ " there is no problem here, the trouble come from "non-sealed class Book implements Readable { }" because this last one "no extends the sealed class THAT permits it.
Am I wrong?
About Question enthuware.ocpjp.v17.2.3688
Moderator: admin
-
- Posts: 1
- Joined: Sun Apr 21, 2024 10:38 pm
- Contact:
-
- Site Admin
- Posts: 10090
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3688
>Why the option "Making the Book class extend Document will eliminate all compilation errors." is correct?
Because it does fix the compilation errors in the code as given. Did you try it?
>1 - "sealed class Document implements Readable permits Book{ " there is no problem here, the trouble come from "non-sealed class Book implements Readable { }" because this last one "no extends the sealed class THAT permits it.
Correct. That is why the option is asking you to make the Book class extend Document. i.e.:
non-sealed class Book extends Document implements Readable{ }
Because it does fix the compilation errors in the code as given. Did you try it?
>1 - "sealed class Document implements Readable permits Book{ " there is no problem here, the trouble come from "non-sealed class Book implements Readable { }" because this last one "no extends the sealed class THAT permits it.
Correct. That is why the option is asking you to make the Book class extend Document. i.e.:
non-sealed class Book extends Document implements Readable{ }
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 3 guests