Hi
For the option c, I believe the following description should be changed:
---------------------------------------------
"Without pattern matching, you would have to do explicit cast like this:
if(a instanceof B b1){
( (B) b1 ).b();
}
-----------------------------------------------------
I believe above code can be changed to:
if(a instanceof B){
( (B) a ).b();
}
Please provide your guidance on it.
Thanks
About Question enthuware.ocpjp.v17.2.3720 :
Moderators: Site Manager, fjwalraven
-
- Posts: 9
- Joined: Mon Apr 15, 2024 11:36 pm
- Contact:
-
- Site Admin
- Posts: 10383
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.3720 :
Yes, you are right. That should be fixed.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 8 guests