MY NAME IS ABDUL BASIT
 Introduction to Inheritance
 Types of Inheritance
 Superclasses and Subclasses
 protected Members
 Constructors in Subclasses
 Class Object
 The deriving the new class from an old one is
called Inheritance.
 The old Class is known as base class or Super
Class .
 The Class who inherit properties of base class is
called derived class or sub class .
 In single inheritance a class is derived from
one superclass
Super class SubClass
Student GraduateStudent,
UndergraduateStudent
Shape Circle, Triangle, Rectangle, Sphere, Cube
Father
Son Daughter Son 2
Super Class
Sub classes
 There are four type of access modifier
 Public ,Private, Protected and Default
 public or protected methods inherited from the
superclass.
 Methods of a subclass cannot directly access
private members of their superclass.
 Member function of Class .
 No return type(it does not return any value )
 Has same name As class.
 Call automatically when an object is
instantiated .
 Constructor of base class is called before the
constructor of Derived Class.
Object Oriented Programming Inheritance java
Object Oriented Programming Inheritance java
Object Oriented Programming Inheritance java
Object Oriented Programming Inheritance java
Object Oriented Programming Inheritance java

Object Oriented Programming Inheritance java

  • 1.
    MY NAME ISABDUL BASIT
  • 3.
     Introduction toInheritance  Types of Inheritance  Superclasses and Subclasses  protected Members  Constructors in Subclasses  Class Object
  • 4.
     The derivingthe new class from an old one is called Inheritance.  The old Class is known as base class or Super Class .  The Class who inherit properties of base class is called derived class or sub class .  In single inheritance a class is derived from one superclass
  • 6.
    Super class SubClass StudentGraduateStudent, UndergraduateStudent Shape Circle, Triangle, Rectangle, Sphere, Cube
  • 7.
    Father Son Daughter Son2 Super Class Sub classes
  • 12.
     There arefour type of access modifier  Public ,Private, Protected and Default  public or protected methods inherited from the superclass.  Methods of a subclass cannot directly access private members of their superclass.
  • 13.
     Member functionof Class .  No return type(it does not return any value )  Has same name As class.  Call automatically when an object is instantiated .  Constructor of base class is called before the constructor of Derived Class.