• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

File input, not happening

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok guys heres the problem, I have a Vector that holds person objects I can get it to out put to a file, but I cant get the program to input these objects back into the array. heres the output code, that actually works

This code works just fine I have no problems here. On the otherhand, Here is where I am haveing major problems. The point of this code is to read the file that had been read into and add that data to any new data that is currently in the vector.


I dont nessesarily need the objects to be put into smaller chunks as in each occourance of a person, but if thats whats going on I dont mind fixing it. For my current purposes though I just need it to be put in place.
additionally the objects in the vector are as such


thanks for any help in advance.
Daniel Gresham
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you serialize your person objects, you iterate the Vector and write each object one at a time. But look at what you do in your loader method. You only read the first object.

Is there a reason why you serialize each person object and not the Vector itself?
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic