How many of the following methods compile?
public String convert(int value) { ? return value.toString(); } public String convert(Integer value) { ? return value.toString(); } public String convert(Object value) { ? return value.toString(); }
C.
Objects have instance methods while primitives do not.
Since int is a primitive, you cannot call instance methods on it.
Integer and String are both objects and have instance methods.
Option C is correct.