I'm trying to implement a simple linked list using Java's LinkedList class but cannot seem to get the compiler to identify the LinkedList methods.
Some simple test code:
import java.util.*;
public class Test {
public static void main(String[] args) {
LinkedList ll = new LinkedList();
ll.add(1);
}
}
This results in the following error:
Test.java:6: error: cannot find symbol
ll.add(1);
^
symbol: method add(int)
location: variable ll of type LinkedList
1 error
I'm sure I'm making some simple mistake but I can't for the life of me seem figure it out on my own. Thanks for any help.