Q. What is the output of the following code?
Code:public static void myMethod(int x) {
System.out.println(x * 2);
}
myMethod(5);
β
Correct Answer: (A)
10
Explanation: The method myMethod takes an integer parameter and prints out its value multiplied by 2. When the method is called with the argument 5, it prints out 10.