Jump to content

ArrayList


Recommended Posts

How can I add elements to a arraylist(I have 5 attributes to add to the arraylist,thoose should be added as the user type them), then save them to a file and be able to read the elements

from the file again.

I apriciate all help!

Link to comment
Share on other sites


I have managed to add elements to the ArrayList that I have created. But now I have problems to get the elements that I have stored. For the moment they are not stored in any file, only in the buffer when I execute the program. I have 5 attributes that I store, 4 are String, 1 is int.

This is how I have tried to get them:(Arrangements is the arraylist)

for (int i = 0; i < Arrangements.size(); i++)

{

System.out.println(Arrangements.get(i));

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...