Convert Linked List Object element to String
Hello,
I have a linked list with the following elements (A,B,C,D)
I created a method to copy the first Node and store it an Object variable called tempNode.
After running the method the tempNode is now set as "A"
So how do I convert this "A" object into a string?
Ive tried this
String newTempNode = new String(tempNode);
and it is complaining about the following
cannot find symbol
symbol: constructor String (java.lang.Object)
location: class java.lang.String
I figured I needed to import a class so I did this
import java.lang.Object;
import java.lang.String;
still gets the same error. What am I doing wrong?