A class is not an object. But it is used to construct objects.   | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

A class is not an object. But it is used to construct objects.  

a)true b)false

16th Jul 2018, 5:42 PM
J Vamsi krishna 😍
5 Answers
+ 2
True. Think of a class as a BLUEPRINT. Just like with normal blueprints, you use them to create the objects in our world; similar to a template that defines what it is and how it behaves.
16th Jul 2018, 6:12 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 2
object => physically exists class => not
17th Jul 2018, 3:03 AM
Tarika
Tarika - avatar
+ 2
See class as a container with an identity that can be accessed with an object when instantiated (created) to use the methods and attributes of the class
17th Jul 2018, 6:34 PM
Emrys
Emrys - avatar
+ 2
saying class is used to construct object is ambiguous
17th Jul 2018, 6:36 PM
Emrys
Emrys - avatar
0
It's not that simple. You can concider class as unique object for creating multiple class instances ('factory') and managing shared resources with class methods. Class handles such functionality as object serialization to send them remotely or store. Class object used to implement remote method call. Java implements reflection with idea of 'class as object'. Class is a way to extend runtime environment with new tools.
22nd Jul 2018, 6:51 AM
Andrey Smirnov
Andrey Smirnov - avatar