Crenox

DVDPlayer Program

Jan 16th, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. package samkough.main;
  2.  
  3. public class DVDPlayer
  4. {
  5. boolean canRecord = false;
  6.  
  7. void playDVD()
  8. {
  9. System.out.println("Starting up the DVD...");
  10. System.out.println("DVD is started!");
  11. }
  12.  
  13. void recordDVD()
  14. {
  15. System.out.println("DVD is Recording...");
  16. }
  17. }
  18.  
  19. ------------------------------------------------------------------------------------------------------------------
  20.  
  21. package samkough.main;
  22.  
  23. public class DVDPlayerTestDrive
  24. {
  25. public static void main(String args[])
  26. {
  27. DVDPlayer d = new DVDPlayer();
  28. d.canRecord = true;
  29. d.playDVD();
  30.  
  31. if(d.canRecord = true)
  32. {
  33. d.recordDVD();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment