可学答题网 > 问答 > 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程序员认证考试题库
相关推荐

1、public static Iterator&ensp

public static Iterator reverse(List list) { Collections.reverse(list); return list.iterator(); } public&ens...

2、static void test() thr

static void test() throws Error { if (true) throw new AssertionError(); System.out.print(test )...

3、public static void mai

public static void main(String[] args) { String str = null‟; if (str == null) {&ensp...

4、public static void par

public static void parse(String str) { try { float f= Float.parseFloat(str); } catch (NumberFo...

5、11. public static void

11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Inte...

6、11. public static void

11. public static void test(String str) { 12. if(str == null  str.lellgth() == 0) {&...