+ 1
Explain the relationship between class and object
3 Respostas
+ 2
Class is prescription for an object. Class defines a behavior for an object.
Object is actual usage of such class, there can (and usually would) be more instances of same class.
Consider class CartoonCharacter { ... }, then Tom would be one instance (object) and Jerry would be second (different) instance of the same class, in famous caroon Tom&Jerry
+ 1
An object is an instance of a class.
0
Thank you