Wednesday, 15 September 2010

Subtypes in java -



Subtypes in java -

if have 4 distinct java types (call them a b c d), , a subtype of b , a subtype of c , b subtype of d , c subtype of d, legal? there examples out there?

drawing diagram:

d | | | | b c | | | |

so d supertype. thanks!

this not legal inheritance, java language not back upwards multiple inheritance.

however can implementing multiple interfaces, different thing multiple inheritance.

so yes it's possible , far can check if instance of interface not same class type, , diagram tad different 1 have drawn.

java subtype

No comments:

Post a Comment