xujunfbi
发贴: 7
积分: 0
|
于 2004-08-05 11:39
QUESTION NO: 49 Given: 10. public Object m() { 11. Object o = new Float(3.14F); 12. Object [] oa = new Object[1]; 13. oa[0] = o; 14. o = null; 15. oa[0] = null; 16. return 0; 17. } When is the Float object, created in line 11, eligible for garbage collection? A. Just after line 13. B. Just after line 14. C. Just after line 15. D. Just after line 16 (that is, as the method returns).
--------------------------------------------------------------------------------
1. public class Test { 2. public static void main(String[] args) { 3. int x = 0; 4. assert (x > 0): “assertion failed”; 5. System.out.println(“finished”); 6. } 7. } What is the result? A. finished B. Compilation fails. C. An AssertionError is thrown. D. An AssertionError is thrown and finished is output.
------------------------------------------------------------------------------------------------
Which two statements are true regarding the return values of property written hashCode and equals methods from two instances of the same class? (Choose two) A. If the hashCode values are different, the objects might be equal. B. If the hashCode values are the same, the object must be equal. C. If the hashCode values are the same, the objects might be equal. D. If the hashCode values are different, the objects must be unequal.
|