I'm studying linked lists from this video from UC Berkeley. However, when I try typing the same version in my Eclipse compiler, like this....
public class CreateLinkedList{
public class Node{
String PlayerName;
Node next;
}
Node first = new Node();
Node second = new Node();
Node third = new Node();
first.PlayerName = "Sanchez";
second.PlayerName = "Ozil";
third.PlayerName = "Welbeck";
public static void main(String[] args) {
}
}
I get the error "Syntax error on token "PlayerName", VariableDeclaratorID expected after this token" on the following lines
first.PlayerName = "Sanchez";
second.PlayerName = "Ozil";
third.PlayerName = "Welbeck";
Can anyone explain where I'm going wrong?