A

Admin • 833K Points
Coach

Q. How many of the following methods compile?

Code:
public class Test
{
public String convert(int value) {
return value.toString();
}
public String convert(Integer value) {
return value.toString();
}
public String convert(Object value) {
return value.toString();
}

public static void main(String... args) {
Test obj = new Test();
System.out.println(obj.convert(10));
}
}
  • (A) None
  • (B) One
  • (C) Two
  • (D) Three
  • Correct Answer - Option(B)
  • Views: 23
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.