Characteristics of Object Oriented Programming

Hello People,  

Did I tell you that I'm gonna do Masters? I think 'no'. I will be doing Advanced Computer Science in Msc in University of Leicester from this Fall. So, I might learn more from this Fall to next Fall academically or technically (precise ;) )


There are six characteristics of OOPs:

  • Class
  • Object 
  • Polymorphism
  • Inheritance
  • Encapsulation 
  • Abstraction 
Class is like a printing machine, and we can print millions of objects from it. 

Advantages 

Code re-usability - the code is reused again when the object is created each time. 
It is relatable to the real world. 

Encapsulation 

Encapsulation is wrapping up variables and methods in class. In other words, combining variables and methods is encapsulation. Before encapsulation, it was difficult to track which method/function is using which member variable. After the encapsulation, it became a single entity. It also helps in data hiding. Click here to learn about data hiding. 

Advantages 

Data hiding 
Conceptualization

Polymorphism

One function can be used in many forms is called polymorphism. For example, in function overloading, functions are overloaded in two different ways: 

1. Number of arguments
2. Data type of arguments 

Single function is capable of doing multiple function with different arguments or different data type. 

Advantages 

Reduces complexity and length of code. 
Function name is denoted with single name.

Inheritance 

Inheritance is known as the property of a child class to inherit the characteristics of a parent class. For example, consider the cars is a parent class, and BMW, AUDI, Volkswagen, etc, are the child classes. Cars class can be inherited by BMW, Audi, Volkswagen, etc., The common functionalities can be placed in Cars (parent) class and different functionalities can be placed in Child class. 

Advantages 

Reduces code duplication by reusing the code of Cars class in BMW, AUDI, etc., 

Abstraction

Abstraction is hiding complicated things from the user by providing only the user interface to the user and hiding the complex functionalities at the behind. 

 

Comments