Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DVD
- {
- private String title;
- private String director;
- private int playingTime;
- private boolean gotIt;
- private String comment;
- public DVD (String theTitle, String theDirector, int time)
- {
- title = theTitle;
- director = theDirector;
- playingTime = time;
- comment = "<no comment>";
- }
- public void setComment (String comment)
- {
- this.comment = comment;
- }
- public String getComment ()
- {
- return comment;
- }
- public void setOwn (boolean ownIt)
- {
- gotIt = ownIt;
- }
- public boolean getOwn()
- {
- return gotIt;
- }
- public void print()
- {
- System.out.print("DVD: " + title + " (" + playingTime + " minsl");
- if(gotIt)
- {
- System.out.println("*");
- }
- else
- {
- System.out.println();
- }
- System.out.println(" " + director);
- System.out.println(" " + comment);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement