Object Oriented Programing

What the heck is this Object Oriented Programming (OOP) ? Is it the brother of the black-hole when it is converting in to the worm-hole with out breaking the law of relativity? Just kidding. Ignore this crazy part. It’s like a thing as it is. It’s like a thing that it should be. Just chill, It’s nothing like that. It’s as clear as water. — As I told to one of my chemist friend

We all know dog can bark. But different breeds of dogs has different barking style.

Also every car can be driven on road but different cars has different speed. Different cars has different price tags.

We the normal human has two eyes, but they are not exactly same for each and every person. Some has blue eyes and some has black eyes.

So actually what I’m wanting to say is that see the world through the glass of an object oriented programmer then it will become very easy to understand the OOP concept. Basically in the object oriented programming what we see daily are treated like an object. e.g. Audi is an object, Honda is an object. Blue eyes are object, Black eyes also are object. Coconut tree is an object and also Mango tree is an object.

But all these object have few common characteristics and few uncommon characteristics. If I consider the examples of two objects like Audi and Honda. They both are car but they have different price tags, different interior. Same goes for coconut and mango tree, They both are tree but they have different characteristics. They give different fruits.

But Audi and Mango tree are not belonging to same class. But all trees belong to tree class. They all produce oxygen to make their food from sun ray. So save the trees and save the World!!! Just kidding.

So I hope we all are clear now what is a class and what is an object in OOP. Actually in any object oriented programming language the class and object is the main concept. All the coding will be done based on these objects.

So we can say now that Audi and Honda both belongs to the car class. And the Mango tree and coconut tree belongs to the Tree class.

So as a OOP programmer I can tell that Tree class can be used as a common class to make individual tree objects like Mango tree. So in other words an object is an instance of a class. So different objects like mango tree , palm tree can belong to the same Tree class.