单项选择题
执行下列程序段之后,变量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
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下面代码的运行结果是( )。 public class ConcatTest public static void main (String[ ] args) String str1 = abc ; String str2 = ABC ; String str3 = str1. coneat(str2); System. out. println(str3);
A.abc
B.ABC
C.abcABC
D.ABCabc
点击查看答案&解析
单项选择题
下面程序段的输出结果是( )。 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
点击查看答案&解析
相关试题
switch语句中,case分支如果包含多条语句,...
假设变量sum=0和j=80都是int类型,则...
main()方法的返回值类型是( )。
执行下列代码后,输出的结果为( )。 cl...
下列方法中可以用来创建一个新线程的是( )。