public class MethodMaze { public static int a(int number) { return number * 2; } public static int b(int number) { return c(number + 5); } public static int c(int number) { if (number % 2 == 0) { return b(number); } else { return d(number); } } public static int d(int number) { int sum = number + 15; return sum * 3; } public static void main(String[] args) { int x = 2; System.out.println(c(a(x))); } } 1) List the function/method names in the order in which the computer executes the functions/methods. 2) What is the output when MethodMaze is compiled and executed with the initial value of x set to 2? 多项选择题
A
1). main, a, b, c, d 2). 72
B
1). main, a, c, b, d, c 2). 54
C
1). main, a, c, b, c, d 2). 62
D
1). main, a, c, b, c, d 2). 72
E
1). main, c, a, b, c, d 2). 62
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!