| ||Specialization, Extension, and Inheritance - slide 40 : 40|
Inheritance and Variables
Variables (fields) are inherited
Variables cannot be virtual
- A variable can be redefined in the sense:
- Same name in super- and subclass: two entirely different meanings (new)
An illustration of "non-virtual variable access".
Similar illustration with virtual properties.
Classes for exercise.
Non-virtual variables - Virtual Methods
We do not normally use public instance variables!