About Question enthuware.ocpjp.v21.2.3726 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
giginar
Posts: 21
Joined: Fri Feb 07, 2025 5:36 pm
Contact:

About Question enthuware.ocpjp.v21.2.3726 :

Post by giginar »

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?

admin
Site Admin
Posts: 10436
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 106 guests