Question: writestubsfor each class so that your code compiles. Java code please Song.java This class collects methods/data for a song, public Song(String title, String artist) -

writestubsfor each class so that your code compiles.writestubsfor each class so that your code compiles.Java code please Song.java ThisJava code please

Song.java This class collects methods/data for a song, public Song(String title, String artist) - construct a new instance of the Song class with the specified song title and artist. public String getTitle() - return the title of the song. public String getArtist() - return the artist of the song. public int getTimes Played() - return the number of times this song has been played. public void play() - "play" this song. To play a song you just print out a description of the song public String toString() - return a string description of this song. It should be of the format: title by artist, timesPlayed play($). So if you have the song God's Plan by Drake and it has been played 27 times, it should return "God's Plan by Drake, 27 play(s)" Library.java This class must keep track of the library of songs in your Spotify program. This comes from the file in songFiles. That filename is passed in as a command-line argument. public Library() - constructs a new instance of this class. public Song getSong(String title) - returns the Song associated with the String title passed in if it exists in the library, or null if the song does not exist in the library. public ListgetAllSongs() - returns a list of all the songs in the library. public void addSong(Song song) - adds the passed in song to the library. public void remove Song(Song song) - removes the passed in song from the library if it exists in the library. public String toString() - returns a string representation of this library. The format is to have the string representation of each song on its own line. So you want to add the string representation of a song, then a newline for each song

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!