Page 1 of 1

About Question enthuware.ocpjp.v21.2.3721 :

Posted: Sat Oct 26, 2024 6:15 am
by mario.danelli
I think also the first response is valid in Java 21 with the statement "if (a instanceof A a1) a1.a();" considering in Java 21 is possible to use the instance of also for the type of which the variable is created.

Re: About Question enthuware.ocpjp.v21.2.3721 :

Posted: Sat Oct 26, 2024 8:57 pm
by admin
You are right. This restriction was removed in Java 21. This has now been fixed.
thank you for your feedback!