Foo has the value of 0.
Foo has the value of null.
Foo has the value of true.
Foo has the value of false.
An exception is thrown.
The code will not compile.
第1题:
A.foohasthevalueof0.
B.foohasthevalueofnull.
C.foohasthevalueoftrue.
D.foohasthevalueoffalse.
E.An-exceptionisthrown.
F.Thecodewillnotcompile.
第2题:
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
第3题:
下列关于boolean类型的叙述中,正确的是
A.可以将boolean类型的数值转换为int类型的数值
B.可以将boolean类型的数值转换为字符串
C.可以将boolean类型的数值转换为char类型的数值
D.不能将boolean类型的数值转换为其他基本数据类型
第4题:
下列代码的编译或执行结果是( )。 public class Myval{ public static void main(string args[]){ MyVal m=new MyVal; aMethod; } public void aMethod{ boolean b[]=new Boolean[5]; System.OUt.println(b[0]); } }
A.1
B.null
C.0
D.编译错误
第5题:
下列布尔变量定义中,正确并且规范的是
A.BOOLEAN canceled=false;
B.boolean canceled=false;
C.boolean CANCELED=false;
D.boolean canceled=FALSE;
第6题:
A.Foohasthevalueof0.
B.Foohasthevalueofnull.
C.Foohasthevalueoftrue.
D.Foohasthevalueoffalse.
E.Anexceptionisthrown.
F.Thecodewillnotcompile.
第7题:
阅读下面程序 public class My Val{ public static void main(String args[]){ My Val m=new My Val(); m. amethod(); } public void amethod(){ boolean b[]=new Boolean[5]; } } 程序编译或运行结果是
A.1
B.null
C.
D.编译不能过
第8题:
( 12 )下列布尔变量定义中,正确并且规范的是
A )BOOLEAN canceled = false;
B)boolean canceled = false;
C)boolean CANCELED = false;
D)boolean canceled = FALSE;
第9题:
在匹配器(Matcher)类中,用于寻找下一个模式匹配串的方法是( )。
A.static boolean matches
B.boolean matcher.find
C.int matcher.start
D.int matcher.end
第10题:
下列关于boolean类型的叙述中,正确的是( )。
A.可以将boolean类型的数值转换为int类型的数值
B.可以将boolean类型的数值转换为字符串
C.可以将boolean类型的数值转换为char类型的数值
D.不能将boolean类型的数值转换为其他基本数据类型