Uso genérico con problemas de clase interna.
No estoy publicando el código completo. Tengo esto:
public class LinkedList2<T extends Comparable<T>> implements Iterable<T> {
private Node<T> head;
private Node<T> tail;
private int numOfElem;
private class Node<T> {
Node<T> next;
T data;
Node(Node<T> next, T data) {
this.next = next;
this.data = data;
}
}
private class LinkedList2Iterator<T> implements Iterator<T> {
private int count = LinkedList2.this.numOfElem;
private Node<T> current = LinkedList2.this.head;
}
}
Enjavac -Xlint LinkedList2.java
Me sale este error:
LinkedList2.java:134: incompatible types
found : LinkedList2<T>.Node<T>
required: LinkedList2<T>.Node<T>
private Node<T> current = LinkedList2.this.head;
^
1 error
¿Puede usted ayudar?