I have the following classes:
List.java:
package list;
public class List<T> {
private Node<T> first = null;
public List () {
this.first = new Node<T>(null);
}
}
Node.java:
package list;
public class Node<T> {
T data;
Node<T> next = null;
public Node(T t) {
this.data = t;
}
}
I'm getting these errors while trying to compile:
List.java:17: error: cannot find symbol
private Node<T> first;
^
symbol: class Node
location: class List<T>
where T is a type-variable:
T extends Object declared in class List
List.java:25: error: cannot find symbol
this.first = new Node<T>(null);
^
symbol: class Node
location: class List<T>
where T is a type-variable:
T extends Object declared in class List
What am I missing?