This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: CNI vs interfaces
- To: Mo DeJong <mdejong at cygnus dot com>
- Subject: Re: CNI vs interfaces
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 03 Aug 2000 16:06:42 +1200
- CC: java-discuss at sourceware dot cygnus dot com
- References: <Pine.SOL.3.91.1000802205247.16832A-100000@cse.cygnus.com>
Mo DeJong wrote:
> // File ICast.java
> 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.
Huh? As far as I know, this is not something you can do with Java either. Or
do I misunderstand your example?
regards
[ bryce ]