单项选择题
A. Foo { public int bar() { return 1; } }
B. new Foo { public int bar() { return 1; } }
C. newFoo() { public int bar(){return 1; } }
D. new class Foo { public int bar() { return 1; } }
单项选择题 10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?()
单项选择题 public class Pass { public static void main(String [1 args) { int x 5; Pass p = new Pass(); p.doStuff(x); System.out.print(” main x = “+ x); } void doStuff(int x) { System.out.print(” doStuff x = “+ x++); } } What is the result?()
单项选择题 23. Object [] myObjects = { 24. new integer(12), 25. new String(”foo”), 26. new integer(5), 27. new Boolean(true) 28. }; 29. Arrays.sort(myObjects); 30. for( int i=0; i31. System.out.print(myObjects[i].toString()); 32. System.out.print(” “); 33. } What is the result?()