Solution of Discussion Forum-1

Solution of Discussion Forum-1

by MD. Hosen Bakaul -
Number of replies: 0

1.Class is a blueprint or template  from which objects are created. But Object is an instance of a class

2.Class is a group of similar objects. But Object is a real world entity such as pen, laptop, mobile, bed, keyboard, mouse, chair etc.

3.Class is a logical entity. But Object is a physical entity

4.Class is declared once. But Object is created many times as per requirement.

5.Class doesn't allocated memory when it is created. But Object allocates memory when it is created.

6.Class is declared using class keyword e.g. class Student{}. But Object is created through new keyword mainly e.g. Student s1=new Student(); .

Let's see some real life example of class and object, Class: Fruit Object: Apple, Banana, Mango .