Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.NumberFormat;
- //Modified by Brian Carey
- public class DVD
- {
- private String title, director;
- private int year;
- private double cost;
- private boolean bluRay;
- public DVD(String title, String director, int year, double cost,
- boolean bluRay)
- {
- this.title = title;
- this.director = director;
- this.year = year;
- this.cost = cost;
- this.bluRay = bluRay;
- }
- public String toString()
- {
- NumberFormat fmt = NumberFormat.getCurrencyInstance();
- String description;
- description = fmt.format(cost) + "\t" + year + "\t";
- description += title + "\t" + director;
- if (bluRay)
- description += "\t" + "Blu-Ray";
- return description;
- }
- public String getDirector()
- {
- return director;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement