This needs a different approach

Saaa empty at needmail.com
Tue Apr 29 14:36:03 PDT 2008


>
> IFruit[] fruits = [APPLE, PLUM, APPLE ... PEAR, PLUM];
>
> Since all fruits inherit from IFruit, they can all be represented as 
> IFruit references.  So, if you have an array of IFruit, you can put all 
> different kinds of fruits in it.

Calling 'fruit[2].eat();' would call eat() from that specific APPLE, right? 




More information about the Digitalmars-d-learn mailing list