It also lets you store a collection of 'Animals' in a collection without having to have a collecton of dogs, a collection of cats, a collection of llamas, a collection of...I think you know where I am going. You can just have a collection of Animals, and add any class dervied from Animal to it.
class Animal {}; class Cat : Animal {}; class Dog : Animal {}; List<Animal>_myListOfAnimals = new List<Animal>(); Animal myCat = new Cat(); //assume Cat derived from Animal Animal myDog = new Dog(); //assume Dog derived from Animal _myListOfAnimals.Add( myCat ); _myListOfAnimals.Add( myDog );
Saying this, if you are using inheritence just to have this ability, then interfaces are the way to go.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."