题目内容

下列程序的运行结果是public class Num {public static void main(String[] args) {int x = 3;int y = 5;go(x, y);System.out.printf("x=%d,y=%d", x, y);}protected static void go(int num1, int num2) {if (num1 > num2) {num1 *= 2;} else {num2 += 5;}}}

A. x=3,y=5
B. x=3,y=10
C. x=6,y=5
D. x=6,y=10

查看答案
更多问题

下列程序的运行结果是public class Num {public static void main(String[] args) {int[] arr={3,5};go(arr);for(int i:arr){System.out.print(i+" ");}}protected static void go(int[] num) {if (num[0] > num[1]) {num[0] *= 2;} else {num[1] += 5;}}}

A. 3 5
B. 3 10
C. 6 5
D. 0 1

下列程序的运行结果是public class NumOfEgg {public static void main(String[] args) {System.out.println("value =" + switchIt(4));}public static int switchIt(int x) {int j = 1;switch (x) {case 1: j++;case 2: j++;case 3: j++;case 4: j++;case 5: j++;default: j++;}return j + x;}}

A. value =5
B. value =6
C. value =7
D. value =8

下列程序的运行结果是public class Test{public static void changeStr(String str){str="welcome";}public static void main(String[] args){String str="1234";changeStr(str);System.out.println(str);}}

A. welcome
B. welcome1234
C. 1234welcome
D. 1234

扭转切应力计算公式τ=Tρ/IP适用于

A. 任意截面;
B. 任意实心截面;
C. 任意材料的圆截面;
D. 线弹性材料的圆截面。

答案查题题库