Solution of Discussion Forum-1

Solution of Discussion Forum-1

by MD.MOSTAK AHAMED MRIDUL -
Number of replies: 0

Here is the important difference between class and object:

1. A class is a template for creating objects in a program, but The object is an instance of a class.

2. A class is a logical entity but an Object is a physical entity.

3. A class does not allocate memory space when it is created but an Object allocates memory space whenever they are created.

4. You can declare a class only once but You can create more than one object using a class.

5. Class generates objects but Objects provide life to the class.

For example, we can say, Car is a class. Its objects are Jaguar, BMW, Tesla, etc.