Forums - Open Redstone Engineers

Full Version: Need Java Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I have an arraylist of objects, and I'm trying to save it to a file so that when the program loads again it can read the list from the file and keep going where it left off. 

The problem is that I have no experience in java and apparently no one on the internet has ever tried to save an arraylist of objects to a file.

Any Ideas?
Well there are many ways to do this. What exactly would the objects contain in general?
simplest way i can think of doing it is just using for loops to write it down 1 element at a time, and then do the same thing to read it back, this is pretty much the slowest way to do things.
(07-04-2015, 05:17 AM)Chibill Wrote: [ -> ]Well there are many ways to do this. What exactly would the objects contain in general?

The objects that are in the allraylist have a few variables and a function
(07-04-2015, 03:35 PM)Magazorb Wrote: [ -> ]simplest way i can think of doing it is just using for loops to write it down 1 element at a time, and then do the same thing to read it back, this is pretty much the slowest way to do things.

This didn't appear to work since I have objects in the arraylist
Give us the general structure of the object. What are the fields and their types? Ambiguity is not helpful in this field.
Might be able to serialize it or something...