black

SCJP程序员认证考试

登录

单项选择题

public class Delta { 
static boolean foo(char c) { 
System.out.print(c); 
return true; 
} 
public static void main( String[] argv ) { 
int i =0; 
for ( foo(‘A’); foo(‘B’)&&(i<2); foo(‘C’)){ 
i++ ; 
foo(‘D’); 
} 
} 
} 
What is the result?()  

A. ABDCBDCB
B. ABCDABCD
C. Compilation fails.
D. An exception is thrown at runtime.

相关考题

多项选择题 class A {  protected int method1(int a, int b) { return 0; }  }  Which two are valid in a class that extends class A?()

单项选择题 package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?()

多项选择题 public interface Foo {  int k = 4; 3. }  Which three are equivalent to line 2?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2