Hello,
((AA)a).mAA(); will throw classCastException, right? But I am guessing since a.power() is not equals to 1, it will not execute the if block, so we are safe?
About Question enthuware.ocpjp.v21.2.3726 :
Moderator: admin
-
- Posts: 21
- Joined: Fri Feb 07, 2025 5:36 pm
- Contact:
-
- Site Admin
- Posts: 10436
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v21.2.3726 :
No, why do you think ((AA)a).mAA(); will throw ClassCastException? The code doesn't show any call to TestClass's processBase(Base base) method.
Who is online
Users browsing this forum: No registered users and 116 guests