(求助)The song class
(1) The Song ClassImplement a class called Song that represents a song that is available
at the Music Exchange Center. The class should have these attributes:
• title - a String indicating the title of the song
• artist - a String indicating the artist(s) or band that recorded the song
• duration – an int indicating the number of seconds that the song lasts when played
Implement the following instance methods:
• A zero-parameter constructor.
• A constructor that accepts as parameters the song's title, artist, number of minutes and number of
seconds. (e.g., new Song("Angels Crying", "E-Type", 4, 35))
• A toString() method that returns a string representation of the song showing the title (within
double quotes), the artist and the duration (broken down in minutes and seconds).
For example: "Angels Crying" by E-Type 4:35
Test your code before continuing using this program:
class SongTestProgram {
public static void main(String args[]) {
Song song1, song2, song3;
song1 = new Song();
song2 = new Song("Hey Jude", "The Beatles", 4, 35);
song3 = new Song("Barbie Girl", "Aqua", 3, 54);
System.out.println(song1); // should display "" by 0:0
System.out.println(song2); // should display "Hey Jude" by The Beatles 4:35
System.out.println(song3); // should display "Barbie Girl" by Aqua 3:54
System.out.println(song2.duration); // should display 275
System.out.println(song3.duration); // should display 234
}
}