1.

What is the difference between the class and object in terms of OOP?

Answer»

Object:

  • Object is an instance of a class.
  • Object is a real world entity such as pen, laptop, mobile, chair etc.
  • Object allocates memory when it is created.

Class:

  • Class is a blueprint or template from which objects are created.
  • Class is a group of similar objects.
  • Class doesn’t allocate memory when it is created.


Discussion

No Comment Found