QUESTION:
Suppose we have two classes defined as follows
class ApBase extends Object implements Runnable
class ApBase extends Object implements Runnable
Given two variables created as follows:
ApBase aBase= new ApBase();
ApDerived aDer=new ApDerived();
Which of the following
Java Code fragments will compile and execute without error?
a) Abject obj= aBase;
Runnable rn=obj;
b)Object obj= aBase;
Runnable rn=(Runnable)obj;
c)Object obj= aBase;
Observer ob=(Observer)aBase;
d)Object obj= aDer;
Observer ob2=obj;
*
Which statement is true? Can you give me a reasonable
exlanation for type casting of multiple inheritence like as in this example.
Thanks.
----------------------------------
Koray G��l�
(B.s. Computer engineer)
http://www.geocities.com/korayguclu/ Sertification documents and links...
----------------------------------