[5628] in java-interest
Re: Interface as types
daemon@ATHENA.MIT.EDU (Thomas Ball)
Tue Feb 20 17:34:57 1996
Date: Tue, 20 Feb 1996 13:04:11 -0800
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: nair@BITS.soft.net
Cc: java-interest@java.Eng.Sun.COM
You can't "create an object of interface C" -- interfaces are specifications,
not implementations. The runtime test "instanceof" is overloaded: for
classes it means "is object an instance of the specified class"; for
interfaces it means "does the object's class implement the specified
interface".
Tom Ball
Java Products Group
> My doubt is that suppose two class A & B inplements interface C. Now if
> we call create a object of interface C lets say c and call c.methodname, how
> will it know which method to call that of A or B.
>
> Cheers:-)
> Siju
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com