I added a line that prints out the array elements. And here's what it prints out:
Does anyone have any ideas because I got really confused by putting this debug statement in.
Type: Posts; User: sp11k3t3ht3rd
I added a line that prints out the array elements. And here's what it prints out:
Does anyone have any ideas because I got really confused by putting this debug statement in.
Hey, I just was playing around with the program and it only loads 1 thing from the text file. If you have more than 1 thing in it, it doesn't get loaded. Any ideas? I changed the code to this:
...
Thanks so much!
I meant that when I saved the array list to the file its format was [a,b,c]. I said that I knew you could take the brackets off after the file was saved (making the saved file look like "a,b,c") but...
This is the userInput class:
import java.io.*;
public class userInput {
String input = null;
public String getUserInput(String prompt) {
I saved a,b,c in the text file which came to [a,b,c]. When I loaded it did this:
I'm trying to work out a way to save stuff in a text based game i'm making. The players inventory is an Array List. I worked out how to save the contents of it to a txt file but I have absolutely no...