Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write and Read Records

 
Rose Evans
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You guys...I need some help...
I need to use this file to write a program that will allow me to write or read records of type PetRecord to a file. I need to ask the user if he wants to write or read to a file, and I have to ask for the file name.
And I need to redefine the class PetRecord so that is is serializable.
Im lost....could any of you give me some 'simple' instructions...I'd surely apreciate it.

Thanks a million.
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the information you need is covered here. Read the tutorial, try do something towards your project and then get back to us when your really stuck.
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rose,

In addition to Nigel's advice, I'd also look at tidying up your PetRecord class. In particular, you seem to be following the javabean methodology of getters and setters - as far as your setters are concerned, you should change your the name of your set methods to setXxxxx, where Xxxxx is the name of your class attribute (name, age , weight ). You appear to have quite a bit of repeated code within your class as well. Also, try to keep your constructors together within your class rather than mixing them up with the other methods - it just makes things easier to read.

Regards,
JD
 
Rose Evans
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you guys...I'll see what I can do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic