J
John Comber
Hi
I'd like to create a collection of objects (Employee, Part-time
employee, etc.) where these objects are derived from a base class
(Person).
As I understand it, I have to create a collection with type Person so
that each dervied object can be stored in the same collection.
However, when itterating through the objects in the collection, is
there a way to determine the original type of each object so that I can
cast back to that type to use the properties and method of the derived
objects?
Many TIA
John.
I'd like to create a collection of objects (Employee, Part-time
employee, etc.) where these objects are derived from a base class
(Person).
As I understand it, I have to create a collection with type Person so
that each dervied object can be stored in the same collection.
However, when itterating through the objects in the collection, is
there a way to determine the original type of each object so that I can
cast back to that type to use the properties and method of the derived
objects?
Many TIA
John.