+3

Aren’t objects just copies of classes?

10/12/2019 2:46:00 AM

Subham

7 Answers

New Answer

+7

Objects are instances of class. You can think class as a blueprint and objects as final products made out of that blueprint

+3

Utsav Prasad is your post relevant here?

+1

You can use a copy constructor to make copies of objects, not copies of classes.

+1

Objects are not copies of classes, but objects can inherit some attributes from their classes.

+1

You can probably make a copy of a class by simply extending it but not specialising it further. I.e. not adding any more fields or methods.

0

Another difference between classes and objects... the actual code exists only once and is associated with the class. To further the blueprint analogy, the blueprint has the instructions and the object doesn’t need a copy of the instructions.