可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

public static void tes


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.
参考答案
参考解析:
分类:SCJP程序员认证考试题库