This needs a different approach

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Apr 29 09:49:05 PDT 2008


"Saaa" <empty at needmail.com> wrote in message 
news:fv7ht6$2d6c$1 at digitalmars.com...

> How would you make the array of fruits?
> Something I can iterate over. like:
> fruits[ APPLE,PLUM,APPLE ... PEAR,PLUM];

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. 




More information about the Digitalmars-d-learn mailing list