So this is an exercice given by my teacher. We're creating a SkipList, aka a "LinkedList" with shortcuts. He gave us a class diagram with one interface (AbstractLink) and three class (StartLink and EndLink implement AbstractLink while Link extends StartLink). He also gave us a huge part of the code but i find it surprising that the interface is empty, i dont really understand why it is and he doesn't look like we need to fill it. Anyhow, in the StartLink, he told us to write the constructor.
So i tried to initialize nexts, which is an array of AbstractLink (???), with the parameter n. As far as I searched, it's impossible to do it because the type of the AbstractLink is not defined. But it leaves me clueless with what i have to change ...
public interface AbstractLink<T extends Comparable<T>> extends Comparable<AbstractLink<T>> {
}
public class StartLink<T extends Comparable<T>> implements AbstractLink<T> {
final AbstractLink<T>[] nexts;
public StartLink(int n){
this.nexts = new AbstractLink<T>[n]; //my line
}
And Eclipse gives me this : Cannot create a generic array of ChainonAbstrait
Thanks in advance