1.

Explain four major OOP concepts in Java.

Answer»

Four major concepts RELATED to object-oriented programmings are:

  1. Data encapsulation: It refers to combining both data and methods into a single unit called a class. Data encapsulation helps in hiding the data from an external world.
  2. Data abstraction: Representation of essential features excluding their BACKGROUND details is known as data abstraction.
  3. Inheritance: Deriving existing class properties into a new class is called inheritance. A newly DERIVED class is called the SUBCLASS(child class) and the existing class(parent class) is called the base class. It is helpful for the re-usability of code.
  4. Polymorphism: Polymorphism means the ability of an object to take multiple FORMS. In java, compile-time polymorphism is achieved with the help of method overloading, and run-time polymorphism is achieved with the help of method overriding.


Discussion

No Comment Found