I am trying to create a program that will store user input into nodes of a linked list. I want the user to only have to input the data they wish to be stored, so I am trying to figure out a way to automate the naming of the new Node of my linked list.
I tried using a variable in the place of the name of the new Node, like this:
String name = "node";
int counter = 0;
String happy;
for(int i=0; i<10; i++){
happy = name+counter;
counter++;
Node happy = new Node();
}
along with several variations of this idea, none of which worked.
Any creative solutions? Or perhaps some API I am unaware of?
much thanks,
andrewjm