Crenox

Clock Program

Feb 21st, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. package com.samkough.headfirst;
  2.  
  3. public class Clock
  4. {
  5. public static void main(String args[])
  6. {
  7. ClockTestDrive c = new ClockTestDrive();
  8.  
  9. c.setTime("12:45");
  10. String tod = c.getTime();
  11. System.out.println("time: " + tod);
  12. }
  13. }
  14.  
  15. ------------------------------------------------------------------------------------------------------------------
  16. package com.samkough.headfirst;
  17.  
  18. public class ClockTestDrive
  19. {
  20. String time;
  21.  
  22. void setTime(String t)
  23. {
  24. time = t;
  25. }
  26.  
  27. String getTime()
  28. {
  29. return time;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment