| 31. | Which will declare a method that is available to all members of the same package and can be referenced without an instance of the class? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 32. | Which type of event indicates a key pressed on a java.awt.Component? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 33. | Given: 1. public class Test { 2. public static void main (String [] args) { 3. string foo = “blue”; 4. string bar = foo; 5. foo = “green”; 6. System.out.printIn(bar); 7. } 8. } What is the result? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 34. | Exhibit: 1. class A { 2. public String toString () { 3. return “4”; 4. } 5. } 6. class B extends A { 7. 8. public String toString () { 8. return super.toString() + “3”; 9. } 10. } 11. public class Test { 12. public static void main(String[]args) { 13. System.out.printIn(new B()); 14. } 15. }What is the result? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 35. | 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? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 多项选择 | ||||||||||||
| 36. | Given: 11. public class Commander { 12. public static void main(String[] args) { 13. String myProp = /* insert code here */ 14. System.out.println(myProp); 15. } 16. } and the command line: java -Dprop.custom=gobstopper Commander Which two, placed on line 13, will produce the output gobstopper? (Choose two.) (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 37. | Which of the following statements will cause a compiler error. (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 38. | Which of the following code fragments are legal Java code? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 39. | [Check all correct answers] You are writing a java class in a file named "MyClass.java", this class must be accessible by all classes in a large project. Which of the following would be correct class declarations? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
| |||||||||||||
| 40. | Which of the following Java statements correctly declare an array of int primitives? (该题为必答题)
| 标记为待复查 | ||||||||||
| |||||||||||||
|
| 多项选择 |
| |||||||||||||
| 41. | Which of the following statements will cause a compiler error (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 42. | Given the following code for the Demo class: public class Demo extends Base { private int count; public Demo() { System.out.println("A Demo object has been created"); } protected void addOne() {count++; } } Which of the following statements about the "count" variable is correct? (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 43. | Pick the keyword(s) which can NOT be used as modifiers in declaration of a method in a Java class. (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 44. | Once created, some Java objects are "immutable", meaning they can not have their contents changed. Which of the following classed produce immutable objects? (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 45. | You are writing a java class in a file named "MyClass.java", this class must be accessible by all classes in a large project. Which of the following would be correct class declarations? (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 46. | Which of the following lines of code will compile without error (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 47. | Which of the following are legal identifiers (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 48. | Which of the following are javakeywords (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 49. | Which of the following will compile without error (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
| |||||||||||||||
| 50. | Given: 11. class ClassA {} 12. class ClassB extends ClassA {} 13. class ClassC extends ClassA {} and: 21. ClassA p0 = new ClassA(); 22. ClassB p1 = new ClassB(); 23. ClassC p2 = new ClassC(); 24. ClassA p3 = new ClassB(); 25. ClassA p4 = new ClassC(); Which three are valid? (Choose three.) (该题为必答题)
| 标记为待复查 | ||||||||||||
| |||||||||||||||
|