Easy Tutorial
For Competitive Exams

Java Programming Object Oriented Programming

What is OOP?

OOP Stands for "Object-Oriented Programming." (not Oops!) refers to a programming methodology based on objects, instead of just functions and procedures.

These objects are organized into classes, which allow individual objects to be group together.

Most modern programming languages including Java, C/C++, and PHP, are object-oriented languages, and many older programming languages now have object-oriented versions.

The object-oriented paradigm supports four major principles:

  • abstraction
  • encapsulation
  • inheritance
  • polymorphism

They are also known as four pillars of the object-oriented paradigm.

What is Abstraction?

Abstraction is the process of exposing the essential details of an entity, while ignoring the irrelevant details, to reduce the complexity for the users.

What is Encapsulation?

Encapsulation is the process of bundling data and operations on the data together in an entity is called Encapsulation.

What is Inheritance

Inheritance is a mechanism in which one object acquires the properties and behaviors of parent object.

It’s essentially creating parent-child relationship between classes.

In java, you will use inheritance mainly for code re-usability and maintainability.

What is Polymorphism?

Polymorphism is the ability by which, we can create functions or reference variables which behaves differently in different programmatic context.

In java language, polymorphism is essentially considered into two versions:

  • Compile time polymorphism (static binding or method overloading)
  • Runtime polymorphism (dynamic binding or method overriding)

Advantages of OOP

  • OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
  • OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer.This is particularly useful for developing graphical user interfaces.
  • Through inheritance, we can eliminate redundant code and extend the use of existing classes.
  • The principle of data hiding helps the programmers to built secure program that can’t be invaded by code in other parts of the program.
  • It is possible to have multiple objects to coexist without any interference.
  • It is possible to map objects in the problem domain to those objects in the program.
  • It is easy to partition the work in a project based on objects.
  • Object-oriented systems can be easily upgraded from small to large system
  • Software complexity can be easily managed.
Share with Friends