boolean[]b=newboolean[3]
boolean[]b={true,true,true}
boolean[3]b={true,true,true}
boolean[]b=newboolean[3];b={true,true,true}
第1题:
下列声明和赋值语句错误的是( )。
A.double w=3.1415;
B.String strl="bye":
C.float z=6.74567;
D.boolean true=true:
第2题:
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println("a="+a+"b="+B); c=(b==false); System.out.println("b="+b+"c="+C); } }
A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=true c=false
D.a=false b=false b=true c=false
第3题:
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println(”a=”+a+”b=+b) ; c=(b==false); System.out.printhln(”b=”+b+”c=”+c) ; } }
A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=tree c=false
D.a=false b=false b=tree c=false
第4题:
下面程序段:boolean a=false;boolean b=true;boolean c=(a&&b)&&(!b);boolean result=(a&b)&(!b);执行完后,正确的结果是
A.c=false;result=false
B.c=true,result=true
C.c=true;result=false
D.c=false;result=true
第5题:
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.printin( "a="+a+"b="+b) ; c-(b==false); System.out.println(b="+b+"e="+c) ; } }
A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=true c=false
D.a=false b=false b=true c=false
第6题:
public void foo( boolean a, boolean b ){ if( a ) { System.out.println( “A” ); } else if ( a && b ) { System.out.println( “A&&B” ); } else { 17. if ( !b ) { System.out.println( “notB” ); } else { System.out.println( “ELSE” ); } } } What is correct?()
第7题:
下面均为java关键字的一组是()
第8题:
现有: class Test2 f public static void main (String [] args) { boolean X= true; boolean y=false; short Z=20; if((x==true) && (y=true)) z++; if((y==true) || (++z==22)) z++; System. out .println( "z="+z); } 结果是什么?()
第9题:
将有三个boolean值的数组初始化为true的是()
第10题:
public void testIfA(){ if(testIfB("True")){ System.out.println("True"); }else{ System.out.println("Nottrue"); } } public Boolean testIfB(Stringstr){ return Boolean.valueOf(str); } What is the result when method testIfA is invoked?()
第11题:
Z=21
Z=22
Z=23
Z= 24
第12题:
If a is true and b is true then the output is “A&&B”.
If a is true and b is false then the output is “notB”.
If a is false and b is true then the output is “ELSE”.
If a is false and b is false then the output is “ELSE”.
第13题:
boolean a=false; boolean b=true; boolean c=(a&&b)&&(!b); boolean result=(a&b)&(!b); 执行完后,正确的结果是( )。
A.c=false;result=false
B.c=true,result=true
C.c=true;result=false
D.c=false;result=true
第14题:
下面程序段: boolean a=false; boolean b=true; boolean c=(a||b)&&(b); boolean result=(a|b)&(b); 执行完后,正确的结果是
A.c=false;result=false
B.c=true,result=true
C.c=true;result=false
D.c=false;result=true
第15题:
下面程序段: boolean a=false; boolean b=true; boolean c=(a&&B) &&(!B) ; boolean result=(a&B) &(!B) ; 执行完后,正确的结果是( )。
A.c=false;result=false
B.c=true,result=true
C.c=tree;result=false
D.c=false;result=trae
第16题:
下面均为Java关键字的一组是()
A、boolean,byte,long,true
B、byte, long,true,goto
C、goto ,Boolean,byte,true
D、bool, long,true,auto
第17题:
当执行下面代码时,会输出( )。 Boolean b1 = new Boolean(true); Boolean b2 = new Boolean(true); if (b1 == b2) if (bi.equals(b2)) System. out.printin ("a"); else System. out. println ("b"); else if (bi.equals(b2)) System. out.println ("c"); else System. out.printIn("d");
A.a
B.b
C.c
D.d
第18题:
在Java语言中,语句“boolean? t=1;” 定义了boolean的类型变量t,并给它赋值为true
第19题:
boolean数据类型的数据只有true和false两个值。()
第20题:
以下输出结果console.log(typeof(true));()。
第21题:
class Test2{ public static void main(String [] args){ boolean x=true; boolean y=false; short z=42; if((x==true)&&y=true))z++; if((y==true||++z=44))z++; System.out.println(“z=”+z); } } 结果是什么?()
第22题:
True
Nottrue
Anexceptionisthrownatruntime.
Compilationfailsbecauseofanerroratline12.
Compilationfailsbecauseofanerroratline19.
第23题:
z=42
z=43
z=44
z=45
编译失败
运行的时候有异常抛出