Changes

Jump to: navigation, search

Objective-C Dynamic Binding and Typing with the id Type

11 bytes removed, 21:18, 1 February 2016
m
Text replacement - "<google>BUY_OBJC_BOTTOM</google>" to "<htmlet>objc</htmlet>"
Polymorphism is the ability to have methods with the same name in different classes. For example both our SavingsAccount and CustomerInfo classes in the above examples have ''displayInfo'' methods. Whilst the code and resulting output displayed is different for each method they both ultimately achieve the same result (i.e. displaying the values assigned to the encapsulated instance variables). Polymorphism is a key concept in providing a consistent programming interface to the classes you create in your program. If all the classes have a method that performs a similar task then programming convention dictates that they should be given the same names. This helps both in writing code to work with objects and also with the use of dynamic binding.
<googlehtmlet>BUY_OBJC_BOTTOMobjc</googlehtmlet>
<hr>

Navigation menu