试题详情
单项选择题Which fragment is an example of inappropriate use of assertions? ()

A、 assert (!(map.contains(x))); map.add(x);

B、 if (x > 0){}else { assert (x==0); }

C、 public void aMethod(int x) { assert (x > 0); }

D、 assert (invariantCondition()); return retval;

E、 switch (x) { case 1: break; case 2: creak; default: assert (x == 0);

  • C
  • 关注下方微信公众号,在线模考后查看

热门试题