This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CNI vs interfaces


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 ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]