Results 1 to 3 of 3

Thread: File Write from ArrayList

  1. #1

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Resolved 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]).
    Last edited by x-ice; Feb 25th, 2007 at 07:27 PM.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width