Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package samkough.main;
- public class DVDPlayer
- {
- boolean canRecord = false;
- void playDVD()
- {
- System.out.println("Starting up the DVD...");
- System.out.println("DVD is started!");
- }
- void recordDVD()
- {
- System.out.println("DVD is Recording...");
- }
- }
- ------------------------------------------------------------------------------------------------------------------
- package samkough.main;
- public class DVDPlayerTestDrive
- {
- public static void main(String args[])
- {
- DVDPlayer d = new DVDPlayer();
- d.canRecord = true;
- d.playDVD();
- if(d.canRecord = true)
- {
- d.recordDVD();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment