OOPS And Its Concepts Or Properties In Java

Definition :

OOPS stands for Object Oriented Programming.Object Oriented Programming is the technique to create programs based on the real world. Unlike procedural programming, here in the OOP programming model programs are organized around objects and data rather than actions and logic.

OOPS Concept :

OOPS reduce the code of the program because of the extensive Properties.OOPS
Properties or Concepts are mainly 4 and they are listed below.

1.Encapsulation
2.Abstraction
3.Inheritance
4.Polymorphisam

lets see in detail about the concepts of OOPS.

1. Encapsulation :

It is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper. Idea of encapsulation is to hide how a class does it but to allow requesting what to do.

Example : Medical Capsuals

i.e one drug is stored in Bottom layer and another drug is stored in Upper layer these two layers are combined in single capsual.

2. Abstraction :



Hiding non-essential features and showing the essential features

                                          (or)

Hiding unnecessary data from the users details,is called abstraction.

Example: TV Remote Button

i.e In TV Remote there are numbers, power and other buttons. We can just see those buttons,we don't see the button circuits and wirings.so non-essential features are hidden from the user.

3. Inheritance :




creating a new class from existing class is called Inheritance.reusability is main advantage in inheritance.The new classes, known as derived classes take over (or
inherit) attribute and behavior of the pre-existing classes,which are referred to as base classes (or Parent classes).

Example : Father and Son Relationship

4.Polymorphisam :




The ability to take more than one form. The abiltiy to define more than one function with the same name is called Polymorphism. In java there are two type of polymorphism.

a) compile time polymorphism (overloading)
b) runtime polymorphism (overriding).

This are the 4 main Properties or Concepts of OOPS. You can leave a comment if you have doubt in it.

10 comments:

Rohit P said...

The concept which you explained is entirely development point of view. What about memory point of view? and how these concepts will utilise the memory efficiently than the normal programming? and what about the garbage collection when the run time of application? and how the unused memory is drained out?

Anonymous said...

best explained..

Manjeet Kumar said...

good...

Sayantan said...

Thank You :)

Anonymous said...

nice good

Md.Julhash uddin said...

simple sentence use yo understand............. nice

RAJIV TRIPATHI said...

nice

Anonymous said...

Correct spelling of Polymorphism.

Spider_Cam said...

easy to understand

Spider_Cam said...

easy to understand

Post a Comment