Solved

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

Question 58

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