Solved

Given the Following Class Definition, How Would You Declare an Object

Question 56

Multiple Choice

Given the following class definition, how would you declare an object of the class, so that the object automatically called the default constructor?
Class ItemClass
{
Public:
ItemClass) ;
ItemClassint newSize, float newCost) ;
Int getSize) ;
Float getCost) ;
Void setSizeint newSize) ;
Void setCostfloat newCost) ;
Private:
Int size;
Float cost;
};


A) ItemClass) myItem;
B) ItemClass myItem1, 0.0) ;
C) ItemClass myItem;
D) ItemClass myItem) ;
E) You can not do this

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents