下面程序段; 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
第1题:
下列布尔变量定义中,正确并且规范的是
A.BOOLEAN canceled=false;
B.boolean canceled=false;
C.boolean CANCELED=false;
D.boolean canceled=FALSE;
第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 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
第4题:
在Java语言中,语句“boolean? t=1;” 定义了boolean的类型变量t,并给它赋值为true
第5题:
boolean数据类型的数据只有true和false两个值。()
第6题:
()导致PL/SQL中WHILE循环结束。
第7题:
将有三个boolean值的数组初始化为true的是()
第8题:
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()
第9题:
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?()
第10题:
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”.
第11题:
Boolean exists=Directory.exists (“prefs”);
Boolean exists=(new File(“prefs”)).isDir();
Boolean exists=(new Directory(“prefs”)).exists();
Boolean exists=(new File(“prefs”)).isDirectory();
Boolean exists=true; Try{ Directory d = new Directory(“prefs”); } catch (FileNotFoundException e) { exists = false; }
第12题:
True
Nottrue
Anexceptionisthrownatruntime.
Compilationfailsbecauseofanerroratline12.
Compilationfailsbecauseofanerroratline19.
第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=tree;result=false
D.c=false;result=trae
第14题:
下面均为Java关键字的一组是()
A、boolean,byte,long,true
B、byte, long,true,goto
C、goto ,Boolean,byte,true
D、bool, long,true,auto
第15题:
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?()
第16题:
下面均为java关键字的一组是()
第17题:
A JavaBeans component has the following field: 11. private boolean enabled; Which two pairs of method declarations follow the JavaBeans standard for accessing this field?()
第18题:
为一个boolean类型变量赋值时,可以使用()方式。
第19题:
Which determines if “prefs” is a directory and exists on the file system?()
第20题:
class Test4 { public static void main(String [] args) { boolean x = true; boolean y = false; short z = 42; if((z++ = = 42) && (y = true)) z++; if((x = false) || (++z = = 45)) z++; System.out.println("z = " + z); } } 结果为:()
第21题:
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.
第22题:
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.
第23题:
public void setEnabled( boolean enabled) public boolean getEnabled()
public void setEnabled( boolean enabled) public void isEnabled()
public void setEnabled( boolean enabled) public boolean isEnabled()
public boolean setEnabled( boolean enabled) public boolean getEnabled()
第24题:
对
错