Solved

MysteryClass -First: Int

Question 23

Multiple Choice

MysteryClass
-first: int
-second: double;
+MysteryClass()
+MysteryClass(int)
+MysteryClass(double) ;
+MysteryClass(int, double)
+setData(int, double) : void
+getFirst() : int
+getSecond() : double
+doubleFirst() : int
+squareSecond() : double
+print() : void
+equals(MysteryClass) : boolean
+makeCopy(MysteryClass) : void
+getCopy() :MysteryClass
Which of the following would be a default constructor for the class MysteryClass shown in the accompanying figure?


A) public MysteryClass() { setData(0, 0.0) ; }
B) public MysteryClass(0, 0.0) { setData() ; }
C) public MysteryClass(0) { setData(0, 0.0) ; }
D) private MysteryClass(10) { setData() ; }

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