CNI vs interfaces

Per Bothner per@bothner.com
Wed Aug 2 21:03:00 GMT 2000


Mo DeJong <mdejong@cygnus.com> writes:
> How would the use of C++ multiple inheritance deal with the case
> where a Java interface is casted to an interface that is not
> inherited?
>> interface I1 { void foo(); }
>> interface I2 { void foo(); }
>> public class ICast implements I2 {
> public void foo() {}
> void bar() {
> I2 itwo = new ICast();
> I1 ione = (I1) itwo;
> ione.foo();
> }
> }
>> As far as I know, this is something you can not do with
> pure vitual C++ classes.

Nor is this something you can do in Java.
-- 
	--Per Bothner
per@bothner.com http://www.bothner.com/~per/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /