试题详情
单项选择题 public static void test(String str) { int check = 4;  if (check = str.length()) {  System.out.print(str.charAt(check -= 1) +“, “);  } else {  System.out.print(str.charAt(0) + “, “);  }  }  and the invocation:  test(”four”);  test(”tee”); test(”to”);  What is the result?() 

A、 r, t, t,

B、 r, e, o,

C、 Compilation fails.

D、 An exception is thrown at runtime.

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

热门试题