• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Priming for Serializable File  RSS feed

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to prime this data so I can read it into a serializable file, however I can't get this to prime correctly. Below is the method and my method call.



 
Bartender
Posts: 3307
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are passing in the ArrayList's to put the data into but the first lines of prime method create new ArrayLists. The data is put into the local ArrayList objects which are lost when the method ends.
You need to put the data into the ArrayLists you are passing into the method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!