单项选择题
下面程序段的输出结果是( )。
public class Test t
public static void main(String[] args)
int x=0;
for (int i=1;i<=4;i++)
x=4;
for(int j=1;j<=3; j++)
x=3;
for(int k=1; k<=2; k++) x=x+6;
System. out. println (x);
A.36
B.48
C.144
D.15
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
执行下列程序段之后,变量b的值为( )。 public class Test public static void main (String[] args) int i = 12; int j = 24; boolean b1 = true; booleanb=(j%i==0)&&(! b1) || (j i! =2); System. out. println (b);
A.true
B.false
C.0
D.1
点击查看答案&解析
单项选择题
执行下列代码后,输出的结果为( )。 class Base int x = 30; void setX( ) x=1O; class SubClass extends Base int x=40; void setX ( ) x=20; int getX( ) return super. x; public class Test public static void main(String[ ] args) SubClass sub=new SubClass( ); sub. setX( ); System. out. println(sub, getX( ) );
A.10
B.20
C.30
D.40
点击查看答案&解析
相关试题
下面代码的运行结果是( )。 public cl...