Friday, February 1, 2008

Polymorphism

I'm reading through a PDF on Objective-C 2.0 that I got from the Apple Developer Website.  You have to be an ADC member to view their documents though.  It's like a couple hundred pages though, so it should be a thorough overview of the language.  I can't actually write any code until I get XCode, though, so I have to wait on that before I start developing examples.  So right now I'm just reading through the documentation.  With polymorphism any method that you call on an object such as display could do something different depending on which object it was invoked on.  So if I sent display to an object Square it would call the method display in Square, but this would be a different method than if I called display on the object Circle because a circle would not necessarily be displayed in the exact same way.  So with polymorphism any object could be called to display itself in whatever way it needs to all with the same method call.

No comments: