Method and Field Resolution

Back Up Next

 

Method and Field Resolution
Methods
The actual type of the object governs which implementation of a method is used.
Thus, Widget1 outputs "Widget1" while Widget2 outputs "Widget2" no matter whether it's cast as Widget1 or Widget2
Fields
The type of the reference governs which field is actually accessed.