elibraryportal Logo

OOPs Concepts in Java

OOPs means Object Oriented Programming concepts. OOPs is a Programming methodology it providing some concepts for software development and maintenance.

OOPs Concepts List in Java

  • Object
  • Class
  • Inheritance
  • Polymorphism
  • Abstraction
  • Encapsulation
OOPs Concepts in Java

1) Object

Object is real life entities that has state, behavior and identity is known as an object.
For example, a chair, pen, table, keyboard, bike, etc. every thing is an object

  1. State : It is represented by attributes of an object. It also reflects the properties of an object.
  2. Behavior : It is represented by methods of an object. It also reflects the response of an object with other objects.
  3. Identity : It gives a unique name to an object and enables one object to interact with other object

Example : Dog

Objec Example in Java

2) Class

Class is blue print of an object that means It represents the set of properties or methods.

3) Inheritance

In Inheritance one object acquires all the properties and behaviors of a parent object, it is known as inheritance.

Another Way you can say, one class is allow to inherit the fields and methods of another class.

Note :- The parent class is called the base class or super class. The child class that extends the base class is called the derived class or sub class or child class.

Syntax:

Next Chapter More Details ........

4) Polymorphism

Polymorphism is an OOPs Concepts that allows to perform a single action in different ways. that is called Polymorphism.

Polymorphism in java

This figure show that a single function name can be used to handle the different numbers and different types of arguments.


Types of Polymorphism

  1. Static Polymorphism :- Method overloading can be considered as static Polymorphism example.
  2. Dynamic Polymorphism :- Dynamic polymorphism is a process in which a call to an override method is resolved at runtime rather, that is called runtime polymorphism.
Next Chapter More Details ........

5) Abstraction

Abstraction is a process hide the internal details and showing functionality is known as abstraction.

In another way you can say, where you show only "relevant" data and "hide" unnecessary details of an object from the user.

Example 1:- Phone call, we don't know the internal processing.

Example 2:- Program code

Next Chapter More Details ........

6) Encapsulation

Encapsulation is defined as the wrapping up of data under a single unit.

Example : Tablet

Encapsulation in java