What are some good examples for illustrating the concepts of object-oriented programming? I'm talking about sample classes, classes that would have inheritance, overriding, etc.The only one I can ever think of is of animals. A base Animal class, with Cow that have a different makeCry method or something like that. It sucks. What do you guys use?
Example for explaining object-oriented concepts
object oriented
The classic set of objects I've always seen is Vehicle (base), Car, Truck, Airplane.Edited to expand on the objects.Vehicle could have a method numberOfWheels, which returns an integer.  The Car numberOfWheels would return 4.  The Truck numberOfWheels could return 4, 6, 10, or 18, depending on the type of truck.  The Airplane numberOfWheels would return 17  for a jet airliner (I think).Another method could be engineType, which returns a String.  The Car engineType would return either gasoline or diesel.  The Truck engineType would return either gasoline or diesel.  The Airplane engineType would return either gasoline or jet.You could certainly come up with more methods that vehicles have in common.