0

Concepts of OOPs(Object Oriented Programming)

The concept of Object oriented programming are

    • Inheritance
    • Abstraction
    • Encapsulation
    • Polymorphism

But before these you have to understand classes and object.

Class

Class is combination of methods and datatypes of similar type. Means combination of features of same category for ex. A class transport all transport have name, no. Of tyres, engine etc. So the transport is a class it has some features. So in programing we put these features in a same class to use them later.

Object

Object is a instance of class. It means it is used to access the data of a class. It is a real world entity for example for class transport its user will be its object and there can be many object for a class.

Inheritance

Inheritance is the ability of a class to inherit the features of another class. We use Inheritance when we want to have same data types or methods of a class in another class too. It ensures code re usability and create a parent child relationship between classes.

Abstraction

Abstraction refers to showing only the essential details and hiding the implementation details. For example like in a car the person driving knows only the upper features like steering, gear . But It does not know the inner mechanism because it is not useful for him. Like this abstraction is to restrict  implementation details.

Encapsulation

Encapsulation refers to wrapping up of data into a single unit. The data is restricted from outside world. Only it can be accessed when permission is given.The process of hiding data from outside world is called data hiding.

Polymorphism

Polymorphism is a concept which allows us to do some same operations in a different manner. For ex all animal makes sound but all do it in differently. So one operation and different style. overloading and overriding is used in polymorphism. 

Some examples of polymorphism are function overloading, function Overriding and operator overloading.

 

for more programming topics visit

https://www.devlopersguide.com/category/programming/

for any feedback or queries comment down below.

ks007

Leave a Reply

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