PDA

View Full Version : Question about inheritance and function parameters



Darkhog
28-05-2013, 08:54 PM
Here comes noob question.

Let's say I have class called TSprite. Now I make child class TAnimatedSprite that inherits from TSprite. Can I use objects of class TAnimatedSprite in functions that ask for TSprite object to be passed?

pstudio
28-05-2013, 09:10 PM
Generally yes. It's called polymorphism and is a key property of Object Oriented Programming and Design.