单项选择题
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?()