试题详情
单项选择题 public void test(int x) {  int odd = x%2;  if (odd) {   System.out.println(“odd);  } else {  System.out.println(“even”);  }  }  Which statement is true?() 

A、Compilation fails.

B、 “odd” will always be output.

C、 “even” will always be output.

D、 “odd” will be output for odd values of x, and “even” for even values.

E、 “even” will be output for add values of x, and “odd” for even values.

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

热门试题