Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Track
- {
- private String title;
- private int minutes;
- private int seconds;
- public Track (String title, int minutes, int seconds)
- {
- this.title = title;
- this.minutes = minutes;
- this.seconds = seconds;
- }
- public String getTitle()
- {
- return title;
- }
- public String getLength()
- {
- return (minutes <10 ? "0" + minutes: minutes) + ":" + (seconds <10 ? "0" + seconds: seconds);
- }
- public String toString(String getLength)
- {
- return title + "(" + getLength + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement