About Question enthuware.ocajp.i.v7.2.1037 :

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

Moderator: admin

Post Reply
kilo1981
Posts: 3
Joined: Wed Apr 30, 2014 3:12 pm
Contact:

About Question enthuware.ocajp.i.v7.2.1037 :

Post by kilo1981 »

Is it possible to cast b.methodB() in any way so that this will compile? Thanks!

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

Re: About Question enthuware.ocajp.i.v7.2.1037 :

Post by admin »

Yes, you need to cast b to Sub to achieve that:

Code: Select all

((Sub)b).methodB();

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests