7 inheritance and polymorphism
TRANSCRIPT
Inheritance
Inheritance
Purpose of Inheritance
reuse common methods and attributes among classes without
recreating them
Generalization
Specialization
Extension
based
access the variables and methods of the base class from the derived class
cannot use for invoking the static method
new
hide the methods or variables of the base class
https://gist.github.com/2358859
Method overriding
Method Overriding allows the derived class to override or redefine the methods of the base class.
virtual & override virtual in base class
override in derived class
Sealed Classes
Purpose of Sealed Classes
Polymorphism
Overriding & Overloading
Compile-time & Run-time Polymorphism