Gemstones — OOPS Concepts

Hello Friends,
After long time, Ruchira is back with her little bag of Gemstones.
This time, I would like to share Series of “Gemstones” with you all. I hope all these Gems will help you in your studies.
Why I am starting this??..🤔 Great thoughtful question..
This series is for my dear friends who are at first step of Programming.
Following information will help you to get quick look on Programming with meaningful examples.
So let’s start…
What I am going to share..👐?
Here, I am sharing first and very basics related to programming.
Every programmer have to clear about these things. Those are OOPS Concept..
OOPS Concept means what?
OOPS stands for Object Oriented Programming Concept. In OOPS, Objects are the most important part of program.
We are going to know Object Oriented Programming Concept.
OOPS Concepts means Object Oriented Programming principles :
- Class
- Object
- Inheritance
- Polymorphism
- Abstraction
- Encapsulation
- Association
- Aggregation
- Composition
OOPS concepts — types of pillars :
Major Pillars — Inheritance, Polymorphism, Abstraction, Encapsulation
Minor Pillars — Association, Aggregation, Composition
To understand OOPS concept, let’s relate with Human Body.
Class
A class is group of similar entities.

Example:
Human Body is Class. For functioning (like walk, talk) it has Body Parts (like hands, legs). For functioning Class defines its Properties and its Functions.
Object
An object can be define as a instance of a class.

Example:
Abhishek is an Object of Human Body Class. We can create many objects of an Main Class, like Gita, Kamal, etc.
Inheritance
Class can have subclasses. And subclasses can inherit the properties and functions of Main class.

Example:
In our case Human Body is Main Class. On gender basis if we categorise Main class then there will be two Sub-Classes like Male and Female. As subclasses inherit the most of the properties from Main Class. Same here, Body Parts(like legs, hands) and Functionalities(like Walk, talk) are get inherited in subclass of Main Human Body Class.
So, till this, we have Main Class “Human Body” with properties and functionalities. Class have two subclasses Male and Female. Each class has an objects. Like here Male has Abhishek and Female class has Gita, Kamal.
Abstraction
Provide only required things and hide other details.

Example:
If we go little deep. If we observe internal working of human body, Heart is property(Body Part) and Beats are function. If we choose only executable functionalities and properties, then we will keep Heart as an Abstraction Factor. Hiding inside mechanism.
Encapsulation
Binding of properties to function.

Example:
Consider, the human body parts, two legs are bind together to walk. Same way, fingers bonded by palm for holding things. Here, holding is function and fingers are Properties.
Polymorphism
Ability to take more than one form. An operation may exhibit different behaviours in different instances.

Example:
In Main Human Body class, Male is subclass named Abhishek. He behaves different in different situations. In office, in home, with friends everywhere Human behaviour is different.
That’s it..✌️
Thanks for reading!!