|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#1. Given: 1. interface A { public void aMethod(); } 2. interface B { public void aMethod(); } 3. interface C extends A,B { public void aMethod(); } 4. class D implements B { 5. } 6. Class E extends D implements C { 7. public void aMethod() {} 8. public void bMethod() {} 9. public void cMethod() {} 10. }
What is the result?
Show comments for this question (0)
Add comments
Link to this question
|
|
#4. Given: 1. Public class Car { 2. private int wheelCount; 3. private Sting vin: 5. this.vin = vin; 6. this.wheelCount = 4; 7. } 9. return “zoom-zoom” ; 10. } 12. return “VIN: ‘ + vin + “ wheels: “ + wheelCount; 13. } 14. }
What two must the programmer do to correct the compilation errors? (Choose two.)
Show comments for this question (0)
Add comments
Link to this question
|
|
#5. Given: 1. class ClassA { 2. public int numberOfInstances; 3. protected ClassA(int numberOfInstances) { 4. this.numberOfInstances = number OfInstances; 5. } 6. } 7. public class ExtendedA extends ClassA { 8. private ExtendedA(int numberOfInstances) { 9. super(numberOfInstances); 10. } 11. public static void main (String[] args ) { 12. ExtendedA ext = new ExtendedA(420); 13. System. out. pint(ext. numberOfInstances); 14. } 15. }
Which statement is true?
Show comments for this question (0)
Add comments
Link to this question
|
|
#7. Given: 10. public class starter extends thread { 11. private int x = 2; 12. public static void main (String[] args ) 13. new Starter () .makeItSo(); 14. } 15. public Starter() { 16. x = 5; 17. start(); 18. } 19. public void makeItSo() throws 20. Join(); 21. x = x -1; 23. } 24. public void run() { x *= 2; } 25. }
What is the output if the main() method is run?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.258
|
Server date 15:58 02-12-2008
|
Developed by Zip © 2006
|
|
 |
|
|