I am trying to figure out how to define an array of a certain type of objects that will include the subclasses as well. This is what I have :
Property[] list = new Property[100];
I believe this will define an array of 100 properties, but is it possible for this array to include SubProperty as well. SupProperty is an extension of the Property class.
Thanks very much.
SubPropertyas well, but while retreiving, you'll have to cast it asSubProperty sub = (SubProperty) list[10]. Assuming,list[10]is an instance ofSubPropertyand notProperty