I am basically trying to use my add method to add nodes together. ( similiar to a linked list) but i am not able to add my first node.. i get this error when i run the code. i am not very good at determining what these errors mean...
Exception in thread "main" java.lang.ClassFormatError: Duplicate method name&signature in class file LList$Node
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at LList.add(LList.java:19)
at LListTest.main(LListTest.java:11)
this line of code is currently giving me the error: Node newNode = new Node(newEntry);
public boolean add(T newEntry) {
Node newNode = new Node(newEntry);
if (isEmpty()){
firstNode = newNode;
}else{
Node lastNode = getNodeAt(length);
lastNode.next = newNode; // make last node reference new node
}
length++;
return true;
}