want to read a nested ArrayList from a text file.
I have a nested java ArrayList in a text file. I need to read that ArrayList in a Java program, and work with it. The problem is, whenever I am reading the file, I could only read the ArrayList as a String. Can anyone please help me to read the List in the file, as the same list in the java program?
Actually, I have created a java Arraylist in another program, and have copied the arraylist to a text file. The Arraylist is nested: (e.g. [a, b, [c, [d, e]]] ) Now, I need to read that ArrayList from the text in a java program and work with it. The problem I am facing is, I can read the ArrayList only as a string from the file. I am using :
" FileReader fr = new FileReader ("javaList.txt");
BufferedReader br = new BufferedReader (fr);"
Now, converting that string to a similar nested Arraylist is proving to be difficult for me. I don't know how to do it.
Thanks a lot!