Inheritance in Java
Jury Members
[Link] Ahmed (181-15-1866)
Reaz Uddin Hemel (181-15-1739)
Sharmila Zaman (181-15-1796)
19 March 2019
AGENDA
01 What is a Inheritance?
Get a modern PowerPoint Presentation that is beautifully designed
02 Why use inheritance in java?
03 Java Inheritance Example
04 Terms PowerPoint
Get a modern used in Inheritance
Presentation that is beautifully designed
05 Types of inheritance in java
06 Conclusion
1
What is Inheritance
Inheritance is an important pillar of OOP(Object Oriented
Programming). It is the mechanism in java by which one
class is allow to inherit the features(fields and methods)
of another class. Inheritance represents the IS-A relations
hip which is also known as a parent-child relationship.
2
Why use inheritance
In java
For Method Overriding
For Code Reusability
3
Public class Computer {
String model = "Pavilion 15";
void display1()
{
Java Inheritance Example [Link]("Model: " + model);
}
}
public class Hplaptop extends Computer{
String price = "50000";
String size = "15 inch";
void display2()
{
display1();
[Link]("Price: " + price);
[Link]("Size: " + size);
{
}
4
Terms used in Inheritance
Class: A class is a group of objects which have common properties. It is a templa
te or blueprint from which objects are created.
Sub Class/Child Class: Subclass is a class which inherits the other class. It is
also called a derived class, extended class, or child class.
Super Class/Parent Class: Superclass is the class from where a subclass in
herits the features. It is also called a base class or a parent class.
5
Types of inheritance in java
Single Inheritance Multilevel Inheritance
Hybrid Inheritance
Hierarchical Inheritance Multiple Inheritance
6
Conclusion
Private member Reusability
parent-child relationship
Method Overriding