About Question enthuware.ocpjp.v17.2.3720 :
Posted: Mon Oct 21, 2024 1:01 am
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
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