I have an interface that I want to implement that looks like this, but with more methods. There is just one here for example:
public interface List{
public void add(int position, Album album);
}
Then my class that implements it starts like this, including all the methods present within the interface:
public class SongList implements List{
public void add(int position, Album album){
...my code for this method
}
My compiler tells me two errors. The first - when compiling my List interface - says that the interface List cannot find my Song class:
List.java:23: error: cannot find symbol
public void add(int position, Song item);
^
symbol: class Song
location: interface List
1 error
I have a song class that compiles and is in the same folder as the interface and all of my other java files.
Second - when compiling SongList - the compiler says that I haven't overridden the add() method:
SongList is not abstract and does not override abstract method add(int,Object) in List
public class SongList implements List{
^
1 error
I'm pretty lost here...as far as I have googled I am following all of the rules for interfaces, but apparently not. Any ideas what I'm doing wrong?