CNI vs interfaces

Bryce McKinlay bryce@albatross.co.nz
Wed Aug 2 21:06:00 GMT 2000


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 ]




More information about the Java mailing list