inheritance from interface ans class

Hi AllSay I have interface A and class B.Now I creating class C extands B implements Awho is C's super class? the class or the interface?Can I write somthing like this?A name = new C() or B name = new C()?Thank u in advanceEyal
[284 byte] By [Eyal2007a] at [2007-11-27 3:36:01]
# 1

> Say I have interface A and class B.

> Now I creating class C extands B implements A

> who is C's super class? the class or the interface?

Both A and B are supertypes of C.

> Can I write somthing like this?

>

> A name = new C() or B name = new C()?

Your class C is a subtype of both A and B, so both assignments are legal.

Herko_ter_Horsta at 2007-7-12 8:39:14 > top of Java-index,Java Essentials,New To Java...
# 2

> Hi All

>

> Say I have interface A and class B.

> Now I creating class C extands B implements A

> who is C's super class? the class or the interface?

The class, because you said superclass.

> Can I write somthing like this?

>

> A name = new C() or B name = new C()?

>

> Thank u in advance

> Eyal

Do you have access to a compiler? You could try it and see faster than you

would get an answer from the forum.

DrLaszloJamfa at 2007-7-12 8:39:14 > top of Java-index,Java Essentials,New To Java...