Ive been trying to work this out for a few hours now, but am stuck, hence I am coming here for some help. N.B. I am using BlueJ, to construct these classes, as im still learning.
What I am trying to do is create a PlayList which has a two parameters: name and a ArrayList of tracks. It then creates a playlist and copies the tracks from the list (in order) onto the playlist; but I dont want any help with this part, as of yet.
My issue is I am unsure how to call the ArrayList when constructing the PlayList.. Because the specified type is of .
public class PlayList
{
private String myName;
private ArrayList<Track> myTracks;
private int myDuration;
public PlayList(String name, ArrayList<Track> tracks) {
name = myName;
myTracks = new ArrayList<Track>();
for (Track t : tracks) {
myTracks.add(t);
}
}
}
What happens, in BlueJ, is when I construct a new PlayList class, it provides an empty field box for String name, and for ArrayList tracks. String name is fine, as I can simply put "anything" but am stuck as to the ArrayList tracks?
I know this is probably isnt a very specific question, but I am still learning.