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
About Question enthuware.ocpjp.v17.2.3703 :
Moderator: admin
-
- Posts: 24
- Joined: Wed Sep 28, 2022 9:41 am
- Contact:
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3703 :
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.
Person is a record and it declares a parameter named role. So, a method named role() will be provided automatically by the compiler.
Who is online
Users browsing this forum: No registered users and 7 guests