Solved

Given the Following Class

Question 92

Multiple Choice

Given the following class:
Public class Coin
{
Private String coinName;
Private double coinValue;
) . .
}
Consider the following code snippet that utilizes the Coin class:
Coin coin1 = new Coin("dime", 0.10) ;
Coin coin2 = coin1;
Coin2.setValue(0.15) ;
Which of the following statements is correct?


A) coin1 has a value of 0.10 and coin2 has a value of 0.15.
B) coin1 and coin2 both have the value of 0.10.
C) coin1 and coin2 both have the value of 0.15.
D) coin2 does not have any data in the coinName variable

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