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
πŸ’¬ Discuss
βœ… Correct Answer: (B) One

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
2756
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
96%
Success Rate