Java Inheritance
- Rakesh
Java Inheritance
● Inheritance can be defined as the process where one class acquires the
properties (methods and fields) of another.
● The class which inherits the properties of other is known as subclass (derived
class, child class) and the class whose properties are inherited is known as
superclass (base class, parent class).
extends keyword
● It is used to inherit the properties of a class.
class Parent
{
}
class Child extends Parent
{
}
Types of Inheritance - Single Inheritance
● When a class extends another one class only.
Class A
{
}
Class B extends A
{
}
Types of Inheritance - Multilevel Inheritance
● One can inherit from a derived class, thereby making this derived class the
base class for the new class.
Class X{
}
Class Y extends X{
}
Class Z extends Y{
}
Types of Inheritance - Hierarchical Inheritance
● One class is inherited by many sub classes.
Class X{
}
Class Y extends X{
}
Class Z extends X{
}

More Related Content

PDF
javainheritance
PDF
Inheritance In Java
PPT
Inheritance in java
PPTX
Inheritance in Java
PPTX
Inheritance ppt
PPTX
Java(inheritance)
PPTX
Java Inheritance
PPTX
Inheritance In Java
javainheritance
Inheritance In Java
Inheritance in java
Inheritance in Java
Inheritance ppt
Java(inheritance)
Java Inheritance
Inheritance In Java

What's hot (20)

PPTX
Inheritance in JAVA PPT
PPTX
Inheritance in Java
PDF
itft-Inheritance in java
PPTX
Java inheritance
PPT
Java inheritance
PPTX
inheritance
PPTX
Inheritance in java
PPT
Java: Inheritance
PPTX
Java Inheritance - sub class constructors - Method overriding
PPTX
Inheritance in java
PPTX
Inheritance and its types In Java
PPSX
Learn java objects inheritance-overriding-polymorphism
PPT
04 inheritance
PPTX
Multiple inheritance possible in Java
PDF
java-06inheritance
PPTX
Inheritance in java
PPT
Java Programming - Inheritance
PPT
inheritance
PPT
Inheritance and Polymorphism
Inheritance in JAVA PPT
Inheritance in Java
itft-Inheritance in java
Java inheritance
Java inheritance
inheritance
Inheritance in java
Java: Inheritance
Java Inheritance - sub class constructors - Method overriding
Inheritance in java
Inheritance and its types In Java
Learn java objects inheritance-overriding-polymorphism
04 inheritance
Multiple inheritance possible in Java
java-06inheritance
Inheritance in java
Java Programming - Inheritance
inheritance
Inheritance and Polymorphism
Ad

Similar to Java Inheritance | Java Course (20)

PPT
Module 4 Effect of Reuse on using Inheritance.ppt
PPTX
Inheritance in Java is a mechanism in which one object acquires all the prope...
PPTX
Ayan Das_25300121057.pptx
PDF
Inheritance in Java.pdf
PDF
Inheritance used in java
PPTX
Inheritance
PPTX
Inheritance
PPTX
Unit3 part2-inheritance
PPTX
Unit3 inheritance
PPTX
Inheritance
PPTX
Inheritance
PPTX
Inheritance
PPTX
Inheritance and Polymorphism
PPTX
types of inheritancec , inheritance ,data structures and algorithim oresentat...
PPT
E -COMMERCE.ppt
PPTX
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
PDF
Interfaces .net
PPT
L7 inheritance
PPT
L7 inheritance
PPTX
Inheritance in oops
Module 4 Effect of Reuse on using Inheritance.ppt
Inheritance in Java is a mechanism in which one object acquires all the prope...
Ayan Das_25300121057.pptx
Inheritance in Java.pdf
Inheritance used in java
Inheritance
Inheritance
Unit3 part2-inheritance
Unit3 inheritance
Inheritance
Inheritance
Inheritance
Inheritance and Polymorphism
types of inheritancec , inheritance ,data structures and algorithim oresentat...
E -COMMERCE.ppt
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
Interfaces .net
L7 inheritance
L7 inheritance
Inheritance in oops
Ad

More from RAKESH P (17)

PPTX
Java Comments | Java course
PPTX
Java Constructors | Java Course
PPTX
How to get selected in a Software Product Company ?
PPTX
Types of Software Developers
PPTX
Tokenization using nlp | NLP Course
PPTX
Natural language processing basics
PPTX
Supervised learning
PPTX
Machine learning real time applications
PPTX
What is machine learning
PPTX
Strategy design pattern
PPTX
State design pattern
PPTX
Null object design pattern
PPTX
Memento design pattern
PPTX
Chain of responsibility design pattern
PPTX
Interpreter Design Pattern real-time examples
PPTX
What is String in Java?
PPTX
Visitor design pattern
Java Comments | Java course
Java Constructors | Java Course
How to get selected in a Software Product Company ?
Types of Software Developers
Tokenization using nlp | NLP Course
Natural language processing basics
Supervised learning
Machine learning real time applications
What is machine learning
Strategy design pattern
State design pattern
Null object design pattern
Memento design pattern
Chain of responsibility design pattern
Interpreter Design Pattern real-time examples
What is String in Java?
Visitor design pattern

Recently uploaded (20)

PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
SaaS reusability assessment using machine learning techniques
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Altius execution marketplace concept.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
Decision Optimization - From Theory to Practice
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Electrocardiogram sequences data analytics and classification using unsupervi...
SaaS reusability assessment using machine learning techniques
Rapid Prototyping: A lecture on prototyping techniques for interface design
giants, standing on the shoulders of - by Daniel Stenberg
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Altius execution marketplace concept.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
Build automations faster and more reliably with UiPath ScreenPlay
NewMind AI Weekly Chronicles – August ’25 Week IV
Decision Optimization - From Theory to Practice
Early detection and classification of bone marrow changes in lumbar vertebrae...
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Lung cancer patients survival prediction using outlier detection and optimize...
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Connector Corner: Transform Unstructured Documents with Agentic Automation
SGT Report The Beast Plan and Cyberphysical Systems of Control
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf

Java Inheritance | Java Course

  • 2. Java Inheritance ● Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another. ● The class which inherits the properties of other is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass (base class, parent class).
  • 3. extends keyword ● It is used to inherit the properties of a class. class Parent { } class Child extends Parent { }
  • 4. Types of Inheritance - Single Inheritance ● When a class extends another one class only. Class A { } Class B extends A { }
  • 5. Types of Inheritance - Multilevel Inheritance ● One can inherit from a derived class, thereby making this derived class the base class for the new class. Class X{ } Class Y extends X{ } Class Z extends Y{ }
  • 6. Types of Inheritance - Hierarchical Inheritance ● One class is inherited by many sub classes. Class X{ } Class Y extends X{ } Class Z extends X{ }