• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Serializable

 
Matthew Fyffe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there everyone,
As I get back into the groove of programming, I'm trying to use all the new things my book talks about and Serializable happens to be one of them. So let me get started on what I'm trying to do. I have these objects of my own data type that implement serializable (do I need to do anything besides just say implement serializable for them to be written to files as their class?). So my program has no problem saving a file of these objects and I don't understand what is written in the text file so I'm assuming it's saving them as something.

The trouble arises when I try and load the objects. The code I have there is simply

However, when this stuff is executed, an exception is thrown that says...
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: Description

What does that mean? Do I need to do more than just make the classes say implements Serializable? What else do I have to do so that they can be written simply as their objects. Thanks a lot.
[ March 25, 2005: Message edited by: Matthew Fyffe ]
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Matthew Fyffe:

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: Description

What does that mean?


That means that Description or one of its dependents is not Serializable. You are correct that all you need to do is implement Serializable. How have you declared Description?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!