Given: What is the result of calling search with a valid List implementation? ()
A. 0 B. The result is undefined. C. a D. 2 E. 1 F. c G. b
单项选择题Given the command line java Pass2 and: What is the result? ()
A. doStuff x = 6 main x = 6 B. Compilation fails. C. doStuff x = 6 main x = 7 D. An exception is thrown at runtime. E. doStuff x = 7 main x = 6 F. doStuff x = 7 main x = 7
多项选择题Given: Which five methods, inserted independently at line 5, will compile?()
A. protected int blipvert(long x) { return 0; } B. protected long blipvert(int x) { return 0; } C. private int blipvert(long x) { return 0; } D. private int blipvert(int x) { return 0; } E. public int blipvert(int x) { return 0; } F. protected long blipvert(long x) { return 0; } G. protected long blipvert(int x, int y) { return 0; }
单项选择题Click the Exhibit button. What is the result?()
A. The code will deadlock. B. The code may run with output "2 0 6 4". C. The code may run with no output. D. The code may run with output "0 6". E. An exception is thrown at runtime. F. The code may run with output "0 2 4 6".
单项选择题Given: Which code, inserted at line 15, creates an instance of the Point class defined in Line?()
A. Line l = new Line() ; l.Point p = new l.Point(); B. Line.Point p = new Line.Point(); C. The Point class cannot be instatiated at line 15. D. Point p = new Point();
单项选择题Given: 11. public static void main(String[] args) { 12. Object obj = new int[] { 1, 2, 3 }; 13. int[] someArray = (int[])obj; 14. for (int i : someArray) System.out.print(i + ); 15. } What is the result? ()
A. Compilation fails because of an error in line 13. B. A ClassCastException is thrown at runtime. C. 1 2 3 D. Compilation fails because of an error in line 14. E. Compilation fails because of an error in line 12.