I'm trying to create a simply linked list in which each node is a vector of type Image
,
this is the method I'm using to add the new node but the third line as the penultimate throw me the following error:
"can not infer type arguments for Node < >"
public void Add(E[] Element) {
if (this.first == null) {
this.first = new Node<>(Element);
} else {
Node<E> aux = first;
while (aux.hasNext()) {
aux = aux.getNext();
}
aux.setNext(new Node<>(Element));
}
}