public class Playlist
{
String title;
String genre;
Boolean privatePlaylist = true;
Song[] listOfSongs;
public Playlist(String tl, String gn, Boolean priv)
{
tl = title;
gn = genre;
priv = privatePlaylist;
}
Song[] mostPlayedSongs()
{
return listOfSongs;
}
}
Above is my code. I am trying to create a java class that returns a playlist. I want it to return a title, genre, whether the playlist is private or public. All three of these things are already constructed above. However, to that list, as a fourth property I would like to add an array that lists all the song in the playlist. The array is already a property I created above(Song[]listOfSongs). However, I do not know how to join this array to the other three properties and how to put the songs in this array. Any suggestions?