Basic concepts in Object Oriented Programming (OOP)

 

Basic concepts in Object Oriented Programming



After going through this blog all of your Object Oriented Concepts will be cleared. These concepts are very important for you if you want to master any of the programming language.

So, following are the basic terminologies in object oriented programming : 

Classes :

These are the basic templates for creating objects. Contains some information for creating objects.

If animal is a class then lion, elephant, dog etc. will be its objects.

 

 Objects :

These are the basic runtime entities created using classes. Now it will have some memory allocated, can have some variables and it will have methods that can be called.



Data Abstraction and Encapsulation :

Abstraction is just going through the layers or separation of concerns. Like if you have processor, the layer of abstraction are chips and if we go further in chips the layer of abstraction are semi-conductors. 

 


 
Encapsulation is just wrapping of data and functions into a single unit and nothing more.

Like you have made a class and it contains both data and functions, that's what Encapsulation is just creating a unit. 


 Inheritance :

Just adopting the properties of parent class. Inheritance is just method of editing the template that another class is representing. So, using one template you can create another template(class). 

Its a big example of code reusability upon which OOP is based. Just inherit the function it enhances the code readability so much that code becomes easily understandable.

 

 Polymorphism :

Polymorphism is simply ability to take multiple forms. 




In Above code, You can see all of there functions are named "volume"  but when they are called they run as per the perimeters given with them.So, polymorphism is showed by volume function. 

 Dynamic Binding :

You will come to know which code will run on runtime only this is data binding also called late binding. 

Like if you user inputs a string to Alexa, and that string is current time. Alexa say "Good Morning / Good Evening" according to that time string. 

 

 Message Passing :

Object.message(information)  - Formate

Its just a passing of data in different objects..


 

Comments