List of OOPs Concepts in Java

 

List of OOPs Concepts in Java

  • Objects

  • Classes

  • Object

  • Class

  • Abstraction

  • Inheritance 

  • Polymorphism

  • Encapsulation

Inheritance:

 We can access one class properties  into another class using extends keyword and reusable code purpose.

  • Memory wastage is low.

  • To reduce Object memory we go for inheritance.



Heap memory:

Object we stored in heap memory

RAM->JVM-> Heap memory.


Type of inheritance:

  • Single inheritance

  • Multilevel inheritance

  • Multiple inheritance

  • Hybrid inheritance

  • Hierarchical inheritance


Types of  inheritance:

======================


Single inheritance:

----------------------

Combinations of one parent class and one child class.

Multilevel inheritance:

--------------------------

Child class is accessing more than one parent class in a tree level structure

 

Hierarchical inheritance

-------------------------------

Combination of  one parent and more than one child


Multiple inheritance:

--------------------------

Child class is accessing more than one parent class parallelly.

Java doesn’t support multiple inheritance.

  • Priority problem.

  • Syntax error/ compilation error


Hybrid Inheritance

---------------------------

Combination of Multiple and Hierarchical inheritance




Java does not support Multiple Inheritance:


- Syntax

- Priority Problem


Comments

Popular posts from this blog

Inheritance and Type of Inheritance

DAY 1: Java Course Notes

Interview Topics for Software Testers and QA