Answer:
The output is "A"
Explanation:
public class Solution {
public static void main(String args[]) {
mystery(7);
}
public static void mystery(int a) { System.out.println("A"); }
public static void mystery(double a) { System.out.println("B"); }
public static void mystery(int a, double b) { System.out.println("C"); }
public static void mystery(double a, int b) { System.out.println("D"); }
}
In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.
In the first case; mystery will be called if the argument is int.
In the second case; mystery will be called if the argument is double.
In the third case; mystery will be called if the arguments are int and double.
In the fourth case; mystery will be called if the arguments are double and int.
When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".
Answer: C 475
Explanation: These choices are A. 375, B. 276, and D. 575. so that wolde mean it would be C 475.
One gallon is 3.7854 liter so 4 liters are more than one gallon.
Answer: Java Virtual Machine(JVM)
Explanation: In java,there is the process of the management of the memory by own self or automation , this is known as the garbage collection .The program in it compile to be executed by the java virtual machine(JVM).During this process , object get together in a sort of heap and then unnecessary object are detected which are of no use and delete them to make space for the memory . Therefore, garbage collection is carried out by java virtual machine(JVM).