Skip to content

Commit a88f8a8

Browse files
Update Inheritance.MD
1 parent 3a38b5d commit a88f8a8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Object Oriented Programming/L3 - Inheritance/Inheritance.MD

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,35 @@ class hierarchialinheritance{
161161
//yu.bark(); // Compile Time Error
162162
}
163163
}
164+
```
165+
166+
**Multiple and Hybrid Inheritance can't be achieved by the Java classes it can only be possible by the Java interfaces.**
167+
168+
## Multiple Inheritance
169+
170+
When a class can inherit more than one classes. <br>
171+
172+
In java it means a class cannot extend more than one classes.However, a class can implement more than one or more interfaces from which we can get rid of the impossibility of the Multiple Inheritance.
173+
174+
## Hybrid Inheritance
175+
176+
It is a combination of more than one types of inheritances.
177+
178+
We can achieve thorugh Java Classes.
179+
180+
**UPDATE**
181+
182+
183+
**Why there is no hybrid inheritance in java?** <br>
184+
185+
```
186+
Java supports hybrid inheritance. However, Java doesn't support Multiple Inheritance classes, so in order to achieve hybrid inheritance, multiple inheritances with classes should not be used. Multiple Inheritance with Interfaces is possible.
187+
```
188+
189+
<br>
190+
191+
**Why pointers are not used in Java** <br>
192+
193+
```
194+
Java is a highly secured programming language. Pointers provide direct access to a memory address, and an arbitrary memory location can be accessed, and read and write operations can be performed on it. For the purpose of security Java does not support Pointers.
164195
```

0 commit comments

Comments
 (0)