The Artima Developer Community
Sponsored Link

Java Answers Forum
Serializing classes and saving objects in files throught applets

1 reply on 1 page. Most recent reply: Apr 8, 2002 8:56 AM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Elvia

Posts: 3
Nickname: helvia
Registered: Mar, 2002

Serializing classes and saving objects in files throught applets Posted: Mar 18, 2002 3:39 PM
Reply to this message Reply
Advertisement
How can I create a serialized class to save their instances in a file as objects and then get them as objects with their attributes?

Is it possible to do this with applets?


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Serializing classes and saving objects in files throught applets Posted: Apr 8, 2002 8:56 AM
Reply to this message Reply
Just implementing the java.io.Serializable interface should do !

Just add it to your class.

You may then provide the method
readObject() and writeObject() if you want to do custom Serialization (http://java.sun.com has a tutorial about it).

Don't forget to thorough Unit test you code.

Thomas,
tsmets @ lautre . net

Flat View: This topic has 1 reply on 1 page
Topic: newbie here.  jtable, combo box question Previous Topic   Next Topic Topic: How to make a pane that will show all components rotated with 90* to left

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use