Search:

Type: Posts; User: JGW

Search: Search took 0.08 seconds.

  1. Replies
    11
    Views
    2,162

    Re: Save array to text file

    I've solved it, thank you for the loop sugestion.



    for (int i = 0; i < list.size(); i++)
    writer.write(list.get(i) + "\r\n");
    writer.close();
  2. Replies
    11
    Views
    2,162

    Re: Save array to text file

    Sorry yes my ArrayList, if I write a loop that gets each element it will just overwrite the file each time it loops so I will end up with a file that just has the last element in it. Or is there a...
  3. Replies
    11
    Views
    2,162

    Re: Save array to text file

    The text file has several lines,
    a
    b
    c
    d

    The code runs through each line until it finds what it is looking for, what the user entered, whilst it is doing this it adds the lines into an array....
  4. Replies
    11
    Views
    2,162

    Re: Save array to text file

    I have a text file that includes [a, b, c, d], when this program is run it adds the elements to an array and allows the user to replace an element.

    For example if a user replaces "d" with "e" the...
  5. Replies
    11
    Views
    2,162

    Re: Save array to text file

    I have now edited my thread to include my whole program
  6. Replies
    5
    Views
    9,433

    Re: JAVA = Replace a line in a text file

    Sorry I've changed my method of saving now. Ignore this thread
  7. Replies
    11
    Views
    2,162

    Save array to text file

    I have an array [a, b, c, d] that I wish to save to a .txt file. My code allows a user to edit a specific line of text file as it deletes the rest of the files contents on edit I have decided to...
  8. Replies
    5
    Views
    9,433

    JAVA = Replace a line in a text file

    I want to create a program that will replace some of the text within a text file, however when I attempt to do so it deletes the rest of the file so I'm left with just the replaced line.

    For...
  9. Replies
    3
    Views
    1,134

    Re: Search array in separate class ???

    What do you mean by "the array must be defined at the class level" I'm a beginner in Java.
  10. Replies
    3
    Views
    1,134

    Search array in separate class ???

    So basically I have an array saved in class, I then have a separate class which brings up a form. I wish to use this form to search within the array, i later want to work with the array to edit it. ...
Results 1 to 10 of 12