Solved

Consider the Following Code Snippet

Question 98

Multiple Choice

Consider the following code snippet:
Coin coin1 = null;
System.out.println("Value of coin = " + coin1.getValue() ) ;
What is wrong with this code?


A) coin1 does not refer to an object and will result in an error at run time.
B) You cannot concatenate a numeric value with a string value.
C) The value variable in coin1 has not been set, and will print as 0.
D) There is nothing wrong with this code.

Correct Answer:

verifed

Verified

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

Related Questions