|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#42. Given: 1. class TestA { 2. TestB b; 3. TestA() { 4. b = new TestB(this); 5. } 6. } 7. class TestB { 8. TestA a; 9. TestB(TestA a) { 10. this.a = a; 11. } 12. } 13. class TestAll { 14. public static void main (String args []) { 15. new TestAll().makeThings(); 16. // ...code continues on 17. } 18. void makeThings() { 19. TestA test = new TestA(); 20. } 21. }
Which two statements are true after line 15, before main completes? (Choose two)
Show comments for this question (1)
Add comments
Link to this question
|
|
#47. Given: 1. class A { 2. final public int method1(int a, int b) {return 0; } 3. } 4. class B extends A { 5. public int method1(int a, int b) { return 1; } 6. } 7. public class Test { 8. public static void main(Strings args[]) { 9. B b; 10. System. out. println(“x = “ + b. method1(0, 1)); 11. } 12. }
What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.206
|
Server date 06:10 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|