2. |
What is the difference between an object and a class?
Please select the best answer.
|
|
A. |
An object is an extension of the class construct whose default access privilege is public.
|
|
B. |
The term object is just another way of referring to the public data members of a class.
|
|
C. |
An object is an initialized class variable. |
|
D. |
A class is an initialized object variable.
|
|
The correct answer is C.
An object is a class variable whose members have been initialized. For example, an object of the class student might have the value Clara Barton in the name data member. The other answers supplied are all erroneous in some way. A class is actually an extension of the struct concept whose default access is private.The default access privileges of a struct is public. An object is not just another way of referring to the public data members of a class.
|