I searched many times for general type questions and just did not find anything that helped me understand what I was doing wrong here. I have an interface as follows:
public interface SortAnalysis<E extends Comparable<? super E>> { public long analyzeSort(ArrayList<E> list); }
Now the next step is to create a class that implements this interface. This particular class will use insertion sort, and I need to keep the ArrayList 'E' generic type, so I tried all kinds of things and got the following:
public class InsertionSort<E extends Comparable<? super E>> implements SortAnalysis { @Override public long analyzeSort(ArrayList list) {
My problem is that when I try to do this for a parameter
ArrayList<E> list
the compiler clicks on me about the implementation of the supertype method.
I would really appreciate any direction of help. Thanks!
** I cannot mark this as an answer, but it is. I think my problem was that when I had
SortAnalysis<E>
I did not have the typical typing specified after the class name. **
source share