posted 21 years ago
Hi All,
pls look at the fallowing example,
Given the following definitions and reference declarations, which of these statements are legal?
interface I1 { }
interface I2 { }
class C1 implements I1 { }
class C2 implements I2 { }
class C3 extends C1 implements I2 { }
C1 o1;
C2 o2;
C3 o3;
Select 3 correct options
a class C4 extends C3 implements I1, I2 { }
b o3 = o1;
c o3 = o2;
d I1 i1 = o3; I2 i2 = (I2) i1;
e I1 b = o3;
Answers given r a,d,e.
But in d,the statement I2 i2 = (I2) i1; ,how it is possible as there is no relationship between I1 and I2 inteface.?
[ Jess gave this a bit more descriptive title ]
[ February 24, 2003: Message edited by: Jessica Sant ]
--------------<br />Prashant<br />SCJP-91%