I have 2 problems here.
I am supposed to read from a file that contains the name of players and amount of golds.
So in each line in the file there is one string value and one int value.
My node should store the string value and int value in the same node.
I know there is a next and nextInt but it doesn't work either.
My another problem is storing the data into the node itself.
I think i create the nodes without connecting them.
Because when i tried to print them in my print method, it only print the last element and its only the amount of the gold.
private Node first;
private Node last;
private int size;
public GameManager(File startUpData) throws IOException{
Scanner player = new Scanner(startUpData);
while(player.hasNext() && player.hasNextInt()){
last = new Node(player.next(), player.nextInt(), null);
first = last;
first = first.next;
size++;
}
}