What is the difference between a class and an object?

What is the difference between a class and an object?

Last updated:8/23/2021 7:08:23 AM

1 Answers

Ashutosh Kumar Verma
Ashutosh Kumar Verma

Different between Class and Object-

                                                                                            Class                                                                                  Object
1- A class is like a container which contains variables, methods and properties. An object is an instance of a class 
2- A class is a templet or blueprint in which Objects are created An objects is defines the characteristics about class
3- Class is not exists in real world Object is exists in real world ex- Pen, Book, Chairs etc.
4- Class is a logical entity. Object is a physical entity.
5- A class is created only once. Objects are created many times in class or created one or more objects of a class.
6- Class is not used memory space of System Object are allocate memory space when it created.


Answer