If I hava a class PlayList a class song and a class advertisement and a I create a Listplaylist(in a different class called Index) How can I add songs (or adds) to playlist? It doesn't allow me to do it. I am not allow to use .add in there (index)
public static void PrintPlayList() {
int songsNumber = songs.size();
int addsNumber = adds.size();
for(int i=0; i<songsNumber;i++) {
playlist.add(songs.get(i));
}
After Declaring the list in there
public static List<PlayListStuff> playlist = new ArrayList<PlayListStuff>();
And having the fields song and add in the class PlayListStuff
public class PlayListStuff {
private Song song;
private Add add;
}
public PlayListStuff(Song song) {
super();
this.song = song;
}
public PlayListStuff( Add add) {
super();
this.add = add;
}