Object oriented programming (OOPs) is based on concept of “Objects”.

Object :

Object is real entity of class, or we can say it instance of class. object is collection of attributes and behavior. For example, a dog is an object and its attributes are like as color, name, breed and barking, eating are the behavior of dog.

There are three mechanism of OOPs concept, that help us to implement the OOPs model.

  1. Encapsulation
  2. Polymorphism
  3. Inheritance

Encapsulation :

Encapsulation means wrapping. And as it name says, it wraps the data (variables) and the code (Methods) in Java. It prevents the data and code from being accessed by the code that is defined outside the wrapper.

If we relate it to real world let suppose you have a car and you want to go some place then you only press a start button or use your car keys to start. there is no need to know how the internal things are working to start. so we can say all internal processes are encapsulating from you. And process of starting car doesn’t affect the other process of car.So we can say that all the process are encapsulating from each other.

Polymorphism :

Polymorphism means many forms. It is a feature of that allow general classes to use one interface for their actions.

For example : Animal is a interface that is not a real entity. It have ‘age’, ‘Sex’, ‘weights’ other attributes. That are used by Labrador and other entities.

Inheritance :

It is the process of inheriting the feature of one entity by the other real entity. Inheritance is the concepts of hierarchical classification.

( Figure : Inheritance )

3 Replies to “What is the use of OOPs Concepts?”

  1. Hello, i read your blog occasionally and i own a similar one
    and i was just curious if you get a lot of
    spam comments? If so how do you prevent it, any plugin or anything you can suggest?
    I get so much lately it’s driving me mad so any support is very much appreciated.

    P.S. If you have a minute, would love your feedback on my new website
    re-design. You can find it by searching for «royal cbd» — no sweat if you can’t.

    Keep up the good work!

    Here is my web blog: buy instagram followers

Leave a Reply

Your email address will not be published. Required fields are marked *