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

Java认证考试

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

23.int z=5;  24.  25. public void stuff1(int x) {  26. assert (x> 0);  27. switch(x) {  28. case 2: x= 3;  29. default: assert false; } }  30.  31. private void stuff2(int y) { assert (y < 0); }  32.  33. private void stuff3() { assert (stuff4O); } 34.  35. private boolean stuff4() { z = 6; return false; }  Which is true?() 

  • A、 All of the assert statements are used appropriately.
  • B、 Only the assert statement on line 31 is used appropriately.
  • C、 The assert statements on lines 29 and 31 are used appropriately.
  • D、 The assert statements on lines 26 and 29 are used appropriately.
  • E、 The assert statements on lines 29 and 33 are used appropriately.
  • F、 The assert statements on lines 29, 31, and 33 are used appropriately.
  • G、 The assert statements on lines 26, 29, and 31 are used appropriately.
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题