New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Please tell me the difference between class and object.
3 Answers
+ 4
http://www.diffen.com/difference/Class_vs_Object : This article might help
+ 3
A class can be considered the blueprint of an object.
If your Objects are many cookies you can consider the cookie cutter their class.
Credit goes to Daniel Shiffman
+ 2
Classes are nothing but custom datatypes. Objects are just instances of those datatypes.
Consider 'int a' and 'MyClass obj'. Both of them imply the same thing. Integer is a built in datatype whereas MyClass is a datatype that you defined. Similarly, 'a' and 'obj' are objects of their respective classes/datatypes.