Changes

Jump to: navigation, search

Objective-C Dynamic Binding and Typing with the id Type

48 bytes removed, 15:16, 28 October 2009
no edit summary
<pre>
BankAccount *account1;
account1 = [[BankAccount alloc] init];
</pre>
<pre>
id object1;
object1 = [[SavingsAccount alloc] init];
[object1 setAccount: 4543455 andBalance: 3010.10];
[object1 release];  object1 = [[CustomerInfo alloc] init];  [object1 displayInfo];
object1 = [[CustomerInfo alloc] init];
[object1 displayInfo];
</pre>
== Dynamic Binding ==
Dynamic typing is about being able to dynamically assign objects of different types to a variable while the code is executing. The concept of ''dynamic binding'' involves the ability to to have the same level of flexibility when calling methods on dynamically typed objects.

Navigation menu