boolean类型变量值只能是true或false。

boolean类型变量值只能是true或false。


参考答案和解析
错误

相关考题:

已知如下代码: boolean m=true; if(m==false) System.out.prinfln("False"); else System.out.println("True");A.假B.真C.NoneD.An error will occur when running

以上程序段运行的结果是:______. Dim a(-1 To 5) As Boolean Dim flag As Boolean flag = False Dim i As Integer Dim j As Integer Do Until flag = True For i = -1 To 5 j=j+1 if a(i)= False Then a(i)= True Exit For End If If i = 5 Then flag = True End If Next Loop Print jA.20B.7C.35D.8

( 12 )下列布尔变量定义中,正确并且规范的是A )BOOLEAN canceled = false;B)boolean canceled = false;C)boolean CANCELED = false;D)boolean canceled = FALSE;

单选按钮与复选框对象的Value属性类型不同,且只能取值True或False。()

已知如下代码: boolean m = true; if ( m = false ) System.out.println("False"); else System.out.println("True"); 执行结果是什么?() A.FalseB.TrueC.编译时出错D.运行时出错

已知如下代码: boolean m=true; if (m==false) System.out.println("False"); else System.out.println("True"); 执行结果是( )。A.假B.TreeC.NoneD.An error will occur when running

布尔类型(boolean)的数据只有两种,true和false。() 此题为判断题(对,错)。

3下面程序段的输出结果为( )。 mblic 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=falseB.a=true b=false b=true c=trueC.a=true b=true b=true c=falseD.a=false b=false b=true c=false

boolean a=false;boolean b=true;boolean c=(ab)(!b);boolean result=(ab)(!b); boolean result=(ab)(!b); 执行完后,正确的结果是( )。A.c=false;result=falseB.c=true,result=trueC.c=true;result=falseD.c=false;result=true

下面程序段的输出结果为 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=falseB.a=true b=false b=true c=trueC.a=true b=true b=true c=falseD.a=false b=false b=true c=false

下面程序段: boolean a=false; boolean b=true; boolean c=(a||b)(b); boolean result=(a|b)(b); 执行完后,正确的结果是A.c=false;result=falseB.c=true,result=trueC.c=true;result=falseD.c=false;result=true

下列布尔变量定义中,正确并且规范的是A.BOOLEAN canceled=false;B.boolean canceled=false;C.boolean CANCELED=false;D.boolean canceled=FALSE;

下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(35); 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=falseB.a=true b=false b=true c=trueC.a=true b=true b=tree c=falseD.a=false b=false b=tree c=false

已知如下代码: boolean m=tree; if(m==false) System.out.println("False"); else System.out.pfintln("True"); 执行结果是( )。A.FalseB.TrueC.无结果D.运行时出错

下面程序段: boolean a=false; boolean b=true; boolean c=(aB) (!B) ; boolean result=(aB) (!B) ; 执行完后,正确的结果是( )。A.c=false;result=falseB.c=true,result=trueC.c=tree;result=falseD.c=false;result=trae

public void foo( boolean a, boolean b ){  if( a ) {  System.out.println( “A” );  } else if ( a  b ) {  System.out.println( “AB” );  } else { 17. if ( !b ) {  System.out.println( “notB” );  } else {  System.out.println( “ELSE” );  }  } }  What is correct?()  A、 If a is true and b is true then the output is “AB”.B、 If a is true and b is false then the output is “notB”.C、 If a is false and b is true then the output is “ELSE”.D、 If a is false and b is false then the output is “ELSE”.

比较运算符用于比较两个数,其返回的结果只能是True或False。

下面均为java关键字的一组是()A、boolean ,byte,long,assertB、byte,long,true,gotoC、goto,boolean,byte,nullD、boolean,long,false,auto

boolean数据类型的数据只有true和false两个值。()

将有三个boolean值的数组初始化为true的是()A、boolean[]b=newboolean[3]B、"boolean[]b={true,true,true}"C、"boolean[3]b={true,true,true}"D、"boolean[]b=newboolean[3];b={true,true,true}"

Which determines if “prefs” is a directory and exists on the file system?()  A、 Boolean exists=Directory.exists (“prefs”);B、 Boolean exists=(new File(“prefs”)).isDir();C、 Boolean exists=(new Directory(“prefs”)).exists();D、 Boolean exists=(new File(“prefs”)).isDirectory();E、 Boolean exists=true;  Try{  Directory d = new Directory(“prefs”);  } catch (FileNotFoundException e) {  exists = false;  }

int index = 1;   boolean test = new Boolean;   boolean foo= test [index];  What is the result?()A、 Foo has the value of 0.B、 Foo has the value of null.C、 Foo has the value of true.D、 Foo has the value of false.E、 An exception is thrown.F、 The code will not compile.

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);   }   }   结果为:()  A、z = 42B、z = 44C、z = 45D、z = 46

单选题public void foo( boolean a, boolean b ){  if( a ) {  System.out.println( “A” );  } else if ( a  b ) {  System.out.println( “AB” );  } else { 17. if ( !b ) {  System.out.println( “notB” );  } else {  System.out.println( “ELSE” );  }  } }  What is correct?()A If a is true and b is true then the output is “AB”.B If a is true and b is false then the output is “notB”.C If a is false and b is true then the output is “ELSE”.D If a is false and b is false then the output is “ELSE”.

单选题Which determines if “prefs” is a directory and exists on the file system?()A Boolean exists=Directory.exists (“prefs”);B Boolean exists=(new File(“prefs”)).isDir();C Boolean exists=(new Directory(“prefs”)).exists();D Boolean exists=(new File(“prefs”)).isDirectory();E Boolean exists=true;  Try{  Directory d = new Directory(“prefs”);  } catch (FileNotFoundException e) {  exists = false;  }

单选题现有:  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);      }      结果是什么?()AZ=21BZ=22CZ=23DZ= 24

单选题现有:  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);     }    }  结果为:()A  Z=42B  z=44C  Z= 45D  z= 46

判断题boolean数据类型的数据只有true和false两个值。()A对B错