black

SCJP程序员认证考试

登录

单项选择题

public class Test { 
public int aMethod() { 
static int i = 0; 
i++; 
return i; 
} 
public static void main (String args[]) { 
Test test = new Test(); 
test.aMethod(); 
int j = test.aMethod(); 
System.out.println(j); 
} 
} 
What is the result?()  

A. 0
B. 1
C. 2
D. Compilation fails.

相关考题

单项选择题 public class ArrayTest {  public static void main(String[] args) {  float fl[], f2[];  fl = new float[10];  f2 = f1;  System.out.println(“f2[0]= “ + f2[0]);  }  }  What is the result?()

单项选择题 public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)

单项选择题 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);&ensp;foo(‘C’)){  i++ ;  foo(‘D’);  }  }  }  What is the result?()

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

备案号:湘ICP备2022003000号-2