Basics OOPs Concepts

Object-oriented programming (OOP) is a way of solving problems with computers. In OOPs, you identify the entities (objects) in the problem and their relationship with each other independent and also compute the issues. These entities will be represented by objects in a computer program.

Some features of OOPs that is implemented in Java-


A class in Java is made of data variables (that hold data) and methods (that hold the logic for operations and perform operations on the data). This approach of combining an object's data with its methods is called encapsulation.

Encapsulation helps make the code more robust and makes tracking bugs easier.


Inheritance is a fundamental feature of object-oriented programming. It enables the programmer to write a class based on an already existing class. The already existing class is called the parent class, or superclass, and the new class is called the subclass, or derived class. The main advantages of inheritance are-

  • Code reusability
  • Code maintenance
  • Implementing Object Oriented Programming(OOP)

For more details, you can refer this page.


Polymorphism is a Greek word which means "several forms". It is the most important feature of any object-oriented programming language.

Java supports two types of polymorphism-

  1. Compile time Polymorphism
  2. Runtime Polymorphism

For more details, you can refer this page.


Abstraction is a process of hiding internal working and showing only the essential functionality of the object. It is achieved using classes and interfaces. For example, A Java developer can use Scanner class without knowing how it works.