I'm quite new to Java and I've just encountered an issue with implementing methods from an interface. I tried to search this up online but couldn't find the solution I needed. A simple version of my code is as follows:
Interface:
public interface LinkedList<E> { 
    public int size();
}
Class:
public class SinglyLinkedList<E> implements LinkedList<E> {
    public int size = 0;
    @Override
    public int size() {
        return size;
    }
}
I'm currently using eclipse and it is suggesting that I remove the @Overide tag above the method. When I do, however, it gives me another error claiming that "The method size() of type SinglyLinkedList must override or implement a supertype method." I'm not quite sure what the "supertype method" is referring to.
I'd be much appreciated if someone could explain to me how this should be fixed.
Thanks in advance!


LinkedListyour class is implementing is not the one have defined. Try changing the name toMyLinkedListto test that theory.