0% found this document useful (0 votes)
21 views5 pages

1 Merged

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

1 Merged

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TOPIC:INHERITANCE IN JAVA

NAME: SOUVIK RAKSHIT

ROLL: 18700123182

DEPT. OF CSE , TECHNO INGTERNATIONAL NEWTOWN

EMAIL: [email protected]
Introduction to
Inheritance in Java

Inheritance is an important pillar of OOP(Object-Oriented


Programming). It is the mechanism in Java by which one class is
allowed to inherit the features(fields and methods) of another
class. In Java, Inheritance means creating new classes based on
existing ones. A class that inherits from another class can reuse
the methods and fields of that class. In addition, you can add
new fields and methods to your current class as well.
TYPES OF INHERITANCE
HIERARCHICAL INHERITANCE: MULTIPLE INHERITANCE:
In Hierarchical Inheritance one Multiple Inheritance is the
class sub as a super class for process in which a subclass
more than one sub class. inherits more than one
superclass. HYBRID INHERITANCE:
In general, the
meaning of hybrid
(mixture) is made of
MULTILEVEL INHERITANCE: The more than one thing. In
SINGLE INHERITANCE: Java, the hybrid
inheritance in which a class can
In single inheritance inheritance is the
be derived from another derived
the father of super composition of two or
class is known as Multilevel
class inherit by a more types of
Inheritance.
single sub class. inheritance.
Applications and Merits/Demerits of
Inheritance
Applications Merits Demerits

Inheritance is used in a wide Inheritance promotes code reuse, Inheritance can increase
range of applications, such as provides a hierarchical structure, complexity, make the code harder
creating software frameworks, and enables polymorphism, to understand, and introduce
building hierarchical data leading to more efficient and potential issues like the "fragile
structures, and designing maintainable code. base class" problem if not used
reusable components. carefully.
Conclusion and
References
1 Conclusion
Inheritance is a powerful feature in Java that enables code
reuse and the creation of hierarchical relationships
between classes. Understanding its applications, merits,
and demerits is crucial for designing effective and
maintainable object-oriented programs.

2 References
Java: The Complete Reference by Herbert Schildt,
Effective Java by Joshua Bloch, and the Java Language
Specification.

You might also like