black

SCJP程序员认证考试

登录

单项选择题

10. public class ClassA { 
11. public void count(int i) { 
12. count(++i); 
13. } 
14. } 
And: 
20. ClassA a = new ClassA(); 
21. a.count(3); 
Which exception or error should be thrown by the virtual machine?() 

A. StackOverflowError
B. NullPointerException
C. NumberFormatException
D. IllegalArgumentException
E. ExceptionlnlnitializerError

相关考题

单项选择题 public class Foo {  static int[] a;  static { a[0]=2; }  public static void main( String[] args) {}  }  Which exception or error will be thrown when a programmer attempts to run this code?()

单项选择题 10. public class ClassA {  11. public void methodA() {  12. ClassB classB = new ClassB();  13. classB.getValue();  14. }  15. }  And:  20. class ClassB {  21. public ClassC classC;  22.  23. public String getValue() {  24. return classC.getValue();  25. }  26. }  And:  30. class ClassC {  31. public String value;  32.  33. public String getValue() {  34. value = “ClassB”;  35. return value;  36. }  37. }  Given:  ClassA a = new ClassA();  a.methodA();  What is the result?()

单项选择题 11. public void someMethod(Object value) {  12. // check for null value ....  20. System.out.println(value.getClass());  21. }  What, inserted at line 12, is the appropriate way to handle a null value?()

All Rights Reserved 版权所有©考试题库网(kstiku.com)

备案号:湘ICP备14005140号-3

经营许可证号:湘B2-20140064