/** * Description of a single song from a CD. * * @author Hal Perkins * @version 7/15/01 */ public class Song { // instance variables private String title; // song title private int seconds; // song length in seconds /** * Construct a new song with the given title and length in seconds */ public Song(String title, int seconds) { this.title = title; this.seconds = seconds; } /** * Get the title of this song * @return song title */ public String getTitle(){ return this.title; } /** * Get the length of this song * @return song length in seconds */ public int getSeconds(){ return this.seconds; } /** * Return string representation of this Song * @return String containing song title and length */ public String toString() { return "Song: Title = " + this.title + ", length = " + this.seconds + "."; } }