Advertisement
oxguy3

APCS Ch 5 book questions

Nov 25th, 2013
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. Hayden Schiff
  2. 2013-10-25
  3. AP Computer Science Bell 1
  4. Ch. 5 book questions
  5.  
  6.  
  7.  
  8. >>>> SHORT ANSWER <<<<
  9.  
  10. >> 5.1 <<
  11. hello
  12. hello there
  13.  
  14.  
  15. >> 5.3 <<
  16. A static method is called on the class rather than on an instance, so the instance
  17. variables do not have values when you call a static method.
  18.  
  19.  
  20. >> 5.5 <<
  21. public interface Visible {
  22. public boolean makeVisible();
  23. public boolean makeInvisible();
  24. }
  25.  
  26. Classes could implement this interface by having a boolean "visible" that is set to true
  27. by the former method and to false by the latter method.
  28.  
  29.  
  30. >> 5.7 <<
  31. [N.B. Because I'm doing this work on a tablet, I used multiple spaces in the place of each tab character] The output of the given code:
  32. Before changing the values:
  33. f1 f2 f3
  34. 27 38 49
  35.  
  36. After changing the values:
  37. f1 f2 f3
  38. 999 888 777
  39.  
  40. anInteger: 27
  41. aNum: 888
  42. anotherNum: 49
  43.  
  44.  
  45.  
  46. >>>> MULTIPLE CHOICE <<<<
  47.  
  48. 5.1: D
  49. 5.2: B
  50. 5.3: B
  51. 5.4: A
  52. 5.5: E
  53. 5.6: A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement