,What is OOPs?
It stands for Object-Oriented Programming.
It is based on objects
It follows Bottom-up programming approach.
It is based on real world.
It provides data hiding so it is very secure.
It provides reusability feature.
What is a class?
A class is a collection of objects. Classes don’t consume any space in the memory.
It is a user defined data type that act as a template for creating objects
of the identical type.
A large number of objects can be created using the same class. Therefore, Class is
considered as the blueprint for the object.
What is an object?
An object is a real world entity which have properties and functionalities.
Object is also called an instance of class. Objects take some space in memory.
For eg .
Fruit is class and its object s are mango ,apple , banana
Furniture is class and its objects are table , chair , desk
What is the difference between a class and an object?
Class Object
1. It is a collection of objects. It is an instance of a class.
2. It doesn't take up space in memory. It takes space in memory.
3. Class does not exist physically Object exist physically.
4. Classes are declared just once Objects can be declared as and when required
, What is the difference between a class and a structure?
Class Structure
1.Class is a collection of objects. Structure is a collection of variables of
different data types under a single unit
2. Class is used to combine data and methods Structure is used to grouping data.
together.
3. Class's objects are created on the heap Structure's objects are created on the
memory. stack memory.
4. A class can inherit another class. A structure can't inherit another
structure.
5. A class has all members private by default A structure has all members public by
default
6. Classes are ideal for larger or complex Structures are ideal for small and
objects isolated model objects
Following are the basic features of OOPs -
Inheritance Abstraction
OOP
Encapsulation Polymorphism
It stands for Object-Oriented Programming.
It is based on objects
It follows Bottom-up programming approach.
It is based on real world.
It provides data hiding so it is very secure.
It provides reusability feature.
What is a class?
A class is a collection of objects. Classes don’t consume any space in the memory.
It is a user defined data type that act as a template for creating objects
of the identical type.
A large number of objects can be created using the same class. Therefore, Class is
considered as the blueprint for the object.
What is an object?
An object is a real world entity which have properties and functionalities.
Object is also called an instance of class. Objects take some space in memory.
For eg .
Fruit is class and its object s are mango ,apple , banana
Furniture is class and its objects are table , chair , desk
What is the difference between a class and an object?
Class Object
1. It is a collection of objects. It is an instance of a class.
2. It doesn't take up space in memory. It takes space in memory.
3. Class does not exist physically Object exist physically.
4. Classes are declared just once Objects can be declared as and when required
, What is the difference between a class and a structure?
Class Structure
1.Class is a collection of objects. Structure is a collection of variables of
different data types under a single unit
2. Class is used to combine data and methods Structure is used to grouping data.
together.
3. Class's objects are created on the heap Structure's objects are created on the
memory. stack memory.
4. A class can inherit another class. A structure can't inherit another
structure.
5. A class has all members private by default A structure has all members public by
default
6. Classes are ideal for larger or complex Structures are ideal for small and
objects isolated model objects
Following are the basic features of OOPs -
Inheritance Abstraction
OOP
Encapsulation Polymorphism