Answer:
1. doSomething(5);
B
2. doSomething (5.2, 9);
F
3. doSomething(3, "Hello");
E
4. doSomething("Able", 8)
D
Step-by-step explanation:
The methods presented in the question are overloaded method. Overloaded methods are the feature that is available in some programming languages such as Java where two or more methods can share the same name but with different argument list.
For example,
public static void doSomething(String x)
{
System.out.println("A");
}
public static void doSomething(int x)
{
System.out.println("B");
}
The two overloaded methods above different from one another with the data types (String vs int) in their argument list.
public static void doSomething(String x, int y)
{
System.out.println("D");
}
public static void doSomething(int x, String y)
{
System.out.println("E");
}
Besides, overloaded methods can also possess different sequential order of the arguments. (String , int VS int, String)
A specific version of the overloaded methods will be invoked if the argument list that passed to the method is matched. For example, doSomething(5) will invoke
public static void doSomething(int x)
{
System.out.println("B");
}
whereas doSomething (3, "Hello") will invoke
public static void doSomething(int x, String y)
{
System.out.println("E");
}