File Write from ArrayList
I have an array list full of player (football/soccer) objects that contain information on each player (39 of them).
How can i write the contents of an arraylist to a file?
p.s. I have methods to retrieve all the necessary information from the objects. (The array list is constructed and filled in a different class [not the Player class]).
Re: File Write from ArrayList
Make your "player" class serializable, then use a for each loop and serialize each object in the array list to a separate file
Re: File Write from ArrayList
Quote:
Originally Posted by ComputerJy
Make your "player" class serializable, then use a for each loop and serialize each object in the array list to a separate file
I want to write all objects in the arraylist to the same file.
I have solved it now though, so dont worry.