以下代码的输出结果?
publicclassTest{
staticintx=5;
publicstaticvoidmain(Stringargv[]){
change(x);
x++;
System.out.println(x);
}
staticvoidchange(intm){
m+=2;
}
}
publicclassTest{
staticintx=5;
publicstaticvoidmain(Stringargv[]){
change(x);
x++;
System.out.println(x);
}
staticvoidchange(intm){
m+=2;
}
}
举一反三
- 以下代码的输出结果为? publicclassTest{ publicstaticvoidmain(Stringargv[]){ intx=6; m(x); x++; System.out.println(x); } staticvoidm(inta){ a+=3; } }
- 以下程序段的输出结果为? int x=0; for (x=2;x<=5;x++ ) ; System.out.print(x);
- 以下代码的输出结果 ? public class Test1{ static int x = 3; static { ++x; } public static void main(String args[]){ System.out.println(x); } static { x++; } }
- 设x=2以及y=3,下面代码的输出结果是。if (x >; 2)if(y >; 2){int z = x + y;System.out.println("z is " + z) ;}else{System.out.println("x is " + x) ;} A: x is 2 B: z is 5 C: x is 5 D: 无输出
- 下列代码的输出结果是___________________ for(int y=0; y<4; y++){ for(int x=0; x<5; x++){ System.out.print("*"); } System.out.println(); }