Skip to content

Commit 36fc149

Browse files
author
Vineeta Kande
committed
inheritance module
1 parent f01018f commit 36fc149

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Inheritance/readme.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ Through inheritance, a subclass can access members of its superclass (fields and
1313

1414
Inheritance represents the `IS-A` relationship which is also known as a parent-child relationship.
1515

16-
To inherit from a class, use the **extends** keyword.
16+
To inherit from a class, use the **extends** keyword. This keyword indicates that we are making a new class that derives from an existing class.
1717

1818

1919
## Why use inheritance in Java?
2020
* For Method Overriding (so runtime polymorphism can be achieved).
2121
* For Code Reusability.
2222

2323

24+
## Types of Inheritance in Java
25+
On the basis of class, there can be three types of inheritance in java: single, multilevel and hierarchical.
26+
![](/src/Inheritance/typesofinheritance.jpg)
7.13 KB
Loading

0 commit comments

Comments
 (0)