|
|
Authorized user can see question and answers. Please log in or sign up. 
|
#71. Given: 11. public class Employee { 13. // insert code here 14. 16. return name; 17. } 18. 19. public int getSalary() { 20. return salary; 21. } 22. }
Which, when inserted at line 13, allows another class to get the value of the salary variable, but NOT change the value of the salary variable?
Show comments for this question (0)
Add comments
Link to this question
|
|
#74. Given: 1. interface Flyer { 2. void takeOff(); 3. boolean land(); 4. } 5. class Airplane implements Flyer { 6. public void takeOff() { /* some code */ } 7. // insert code here 8. return true; 9. } 10. }
Which, inserted at line 8, correctly implements the interface?
Show comments for this question (0)
Add comments
Link to this question
|
|
#76. Given: 1. class X { 2. private Y y; 3. public X(Y y) { this.y = y; } 4. } 5. class Y { 6. private X x; 7. public Y() { } 8. public Y(X x) { this.x = x; } 9. }
The instance variable y is intended to represent the composition relationship "X is composed of Y." Which code correctly maintains this meaning?
Show comments for this question (0)
Add comments
Link to this question
|
|
|
|
gen. 0.224
|
Server date 06:35 10-01-2009
|
Developed by Zip © 2006
|
|
 |
|
|