多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

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?()  

  • A、 If a is true and b is true then the output is “A&&B”.
  • 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”.
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题