• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving and reading Persons to/from binary file  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, i could use some help,
everything compiles but doesn't work like it should.

What the idea is, is to be able to add class personnel objects and have them saved in a file, so that later on i would be able to see them.

Back to my problem:
When i create a new "Personnel" and try to run Write and read, to see if my new "Personnel" is added to the list,
it's not there at all... what do i do wrong? i need help!.

Best Regards Mikkel









 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "it's not there at all"? Both codes work fine for me.

The do loop in ReadWR is superfluous as you write and read exactly one object (the List).
 
Mike dawn
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to be able to write more than just one object,
is it possible, and what do you suggest as a solution?

thanks for answering

Ulf Dittmer wrote:What do you mean by "it's not there at all"? Both codes work fine for me.

The do loop in ReadWR is superfluous as you write and read exactly one object (the List).
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WriteAndRead writes 3 objects - what else do you mean by "write more than just one object"?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!