Lecture oop inheritance
Lecture oop inheritance
to OOP
ADVANTAGES OF OOP
Class
Objects
Inheritance
Abstraction
Encapsulation
Polymorphism
INHERITANCE
Sub Class:
–The class that inherits properties from another class is called Sub
class or Derived Class or Child Class.
Super Class:
–The class whose properties are inherited by sub class is called
Super Class or Base Class or Parent Class.
IMPLEMENTING INHERITANCE IN C#
To inherit from a class, use the : symbol.
In the example below, the Car class (child) inherits the fields and methods from the Vehicle class
(parent)
OUTPUT ?
OUTPUT ?
OUTPUT ?
MULTILEVEL INHERITANCE