|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#62. Given: 1. public interface A { 2. public void doSomething (String thing ); 3. } 1. public class AImpl implements A 2. public void doSomething (String msg ) { } 3. } 1. public class B { 2. public A doit( ) { 3. // more code here 4. } 5. 7. // more code here 8. } 9. } 1. public class C extends B { 2. public AImpI doit() { 3. // more code here 4. } 5. 7. // more code here 8. } 9. }
Which statement is true about the classes and interfaces in the exhibit?
Show comments for this question (0)
Add comments
Link to this question
|
|
#69. Given: 10. interface Foo { int bar(); } 11. public class Sprite { 12. public inttubar( Foo foo ) (return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. //insert code here 16. ); 17. } 18. }
Which code, inserted at line 15, allows the class Sprite to compile?
Show comments for this question (0)
Add comments
Link to this question
|
|
#70. Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Java serialization and given: 13. import java .io.*; 15. class Fruit extends Food {int juice = 5;} 16. public class Banana extends Fruit { 17. int yellow = 4; 18. public static void main (String [] args ) { 19. Banana b = new Banana(); Banana b2 = new Banana(); 20. b.serializeBanana(b); // assume correct serialization 21. b2 = b.deserializeBanana(); // assume correct 22. System. out. println(”restore “+b2. yellow+ b2. juice+b2 good ); 24. } 25. // more Banana methods go here 50.}
What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.251
|
Server date 05:33 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|