以下代码的输出结果为?
publicclassTest{
publicstaticvoidmain(Stringargv[]){
intx=6;
m(x);
x++;
System.out.println(x);
}
staticvoidm(inta){
a+=3;
}
}
publicclassTest{
publicstaticvoidmain(Stringargv[]){
intx=6;
m(x);
x++;
System.out.println(x);
}
staticvoidm(inta){
a+=3;
}
}
举一反三
- 以下代码的输出结果? publicclassTest{ staticintx=5; publicstaticvoidmain(Stringargv[]){ change(x); x++; System.out.println(x); } staticvoidchange(intm){ m+=2; } }
- 以下代码的输出结果 ? public class Test1{ static int x = 3; static { ++x; } public static void main(String args[]){ System.out.println(x); } static { x++; } }
- 执行下列程序,输出结果为()。publicclassB{publicstaticvoidmain(String[]args){intx=5;doubley=10.5f;floatz=(float)(x*y);System.out.println(z);}}
- 以下代码段执行后的输出结果为: int x=3; int y =10 ; System.out.println(y%x);
- 以下程序运行后的输出结果是______。main(){intx=15;while(x>10&&x<50){x++;if(x/3){x++;break;}elsecontinue;}printf("%d\n",x);}