The Basic Concept of OOP’s
OOPS stands for object-oriented programming which makes the program easy by dividing into smaller parts
What is an object?
Anything which is visible or tangible is said to be an object, for example, chair, car, pen, etc.
Two aspects of an object are :
Every object has a particular state and behavior
What is the State?
A State defines the character of an object.
What is Behaviour?
A behavior define the functionality of an object.
What is a Class?
Class is a collection of similar types of objects.
Two aspects of a class are:
What are the basic principle of OOP’s?
The act of representing essential features giving the background details is known as abstraction. Example: car, fan, mobile, TV, etc.
The wrapping of data and function into a single unit is known as encapsulation. Example: table, chair, pen, ATM, etc.
The method of passing characters of one class to another class is known as inheritance. Example: cars, human beings, mobile, TV, etc.
When one thing is represented in many forms it is known as polymorphism. Example: milk, area, speech, writing, etc.
Why a class is called an object factory?
The class produces many objects of similar type that is why it is known as an object factory.
Define a variable?
A variable is a named memory location that stores data temporarily.
Since the class is considered as an object factory that is it produces the objects this is how we can say that classes and objects are interrelated.