Search:

Type: Posts; User: dpek

Search: Search took 0.09 seconds.

  1. Re: loading things from a text file into an array list

    Don't forget to mark this topic as solved by changing the topic title to "[SOLVED] loading things from a text file into an array list" ^____^
  2. Re: loading things from a text file into an array list

    There is, but you don't need to, since the last comma is ignored when you load the file.


    I'm guessing you've never seen foreach loops before and you don't know what .split() does.

    .split...
  3. Re: loading things from a text file into an array list

    I'm sorry, but I'm not quite sure what you're trying to say here.

    If you want to convert "a,b,c" to an array [a,b,c], so that the list of elements are put in the array correctly, the try block of...
  4. Re: loading things from a text file into an array list

    However, in your save.java class, you are doing this:


    try {
    PrintWriter save = new PrintWriter(new FileWriter("save.txt"));
    save.print(player.inventory + " ");
    save.close();
    }

    Which...
  5. Re: loading things from a text file into an array list

    Try using savedInv.next() instead of savedInv.nextLine()
Results 1 to 5 of 5