About Question enthuware.ocpjp.v17.2.3703 :

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

Moderator: admin

Post Reply
edufin166@yahoo.com
Posts: 24
Joined: Wed Sep 28, 2022 9:41 am
Contact:

About Question enthuware.ocpjp.v17.2.3703 :

Post by edufin166@yahoo.com »

WOuld not be "There is no problem with any of the marked lines but the given code will not compile." the correct alternative?

Where is the implementation of the method "role" in Person-Record?

""

sealed interface Member permits Student, Person{ //LINE A
String role(); }

record Person(String role) implements Member{ //LINE B }

Thx

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

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

Post by admin »

What happened when you tried compiling the code?

Person is a record and it declares a parameter named role. So, a method named role() will be provided automatically by the compiler.
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 21 guests