Professional Documents
Culture Documents
CHAPTER IN BOOK- 8
PART- I
-K. Indhu
SYLLABUS COVERED
HERE
INHERITANCE
K. INDHU
GOALS
1. Inheritance Definition
2. Inheritance Syntax
3. Inheritance Diagrammatic Example
4. Inheritance Sample Program
5. Public, Private in Inheritance
6. Types of Inheritance in Java
7. No Multiple Inheritance in Java- Why ?
8. Using super
9. Note- super in constructor during inheritance
10. THREE USAGES of super
11. Multi-Level Hierarchy
K. INDHU
INHERITANCE
DEFINITION->DEFINITION
Inheritance in java is a mechanism in which one object
acquires all the properties and behaviors of parent object.
INHERITANCE SYNTAX
DIAGRAMMATIC
EXAMPLE
K. INDHU
SAMPLE PROGRAM
K. INDHU
SAMPLE PROGRAM
K. INDHU
PUBLIC, PRIVATE
K. INDHU
TYPES IN JAVA
K. INDHU
NO MULTIPLE
INHERITANCE IN JAVA
THRU CLASS- WHY ?
K. INDHU
USING SUPER
I. Whenever a subclass needs to refer to its immediate
super-class, it can do so by use of the keyword "super".
II. Whenever the instance of subclass is created, an
instance of parent class is created implicitly i.e. referred
by "super" reference variable.
III.USAGE OF JAVA "super" KEYWORD->
. (i) super is used to refer immediate parent class
instance variable.
. (ii) super() is used to invoke immediate parent
class constructor.
. (iii) super is used to invoke immediate parent
class method.
K. INDHU
USING SUPER
K. INDHU
USING SUPER
K. INDHU
SUPER IN
CONSTRUCTOR
K. INDHU
USING SUPER
K. INDHU
MULTI-LEVEL
HIERARCHY
E:\JavaPrograms\
Exercises\Exercise2\Pe
K. INDHU
SO FAR WE STUDIED
Inheritance
K. INDHU
HAPPY
LEARNING!!!