Hello,
I need help because I get errors that I can not fix. Being more precise i have a problem in the Linked List, I am trying it but I can not fix
Here is my code.
Code:
import java.util .*;
Public class LinkedList{
private Link hd = null;
class Link{
private Link nxt;
private String ele;
Public Link(String ele, nxt Link){
this.ele = ele;
this.nxt = nxt;
}
}
Public void add(String text){
hd = new Link(text, hd);
}
Public Intl size(){
Intl size = 0;
while(hd! = null){
size + +;
hd = hd.nxt;
}
}
Public String toString(){
return ele + " " + nxt.function toString() {
[native code]
}();
}
}
Bookmarks