Question: 5) Consider the following class declaration. public class IntValue { private int myvalue; 1/ constructor not shown public int getvalue() ( return myvalue; 1 public
5) Consider the following class declaration. public class IntValue \{ private int myvalue; 1/ constructor not shown public int getvalue() ( return myvalue; 1 public String tostring () ( return "" + myValue; 1 Assume that the following declaration appears in a client class. IntValue val = new IntValue(); Which of these statements can be used in the client class? I. System. out. println(val. getvalue ()); II. System. out. println(val); III. System. out.println (val.tostring()); (A) I only (B) I and III only Q) II and III only (D) I and II only (E) I, II, and
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
