How to: create a list of objects?
How would you go about creating a list of objects, where each object can
contain a list of objects, and each sub-object would have various
properties(string, int)?
This is an example. The parent object would be forms of transportation -
car, bike, etc. Each parent object has child objects (chevy, ford, etc.) and
each of these child objects has the same properties (number of doors,
color). How would I represent this data? I need some pointers to start me in
the right direction.
Car - Chevy - 4 doors, green paint
- Ford - 2 doors, purple paint
- Nissan - 3 doors, red paint
Bike - 26 inch, green
- 27 inch, purple
|