Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Help with serialization

Thread view: 
Christo - 17 Apr 2006 10:53 GMT
as part of a project at uni i have been asked to provide object persistance
through files

I have opted for serialization

my question is quite simple

when u use serialization is an object saved to a single file or are more
than one object(s) saved to a single file?

say i have three objects, will they all be saved into one file or will there
be three seperate files each having one object saved into them?

also say i have a superclass implmenting the java.io.Serializable

will all subclasses of that superclass automatically implement the
java.io.Serializable or will i need to make those subclasses implement the
Serializable seperately?

any help would be appreciated

PS -
public class UserData implements java.io.Serializablei understand that
but..public class UserData extends User...how would i implement the
java.io.Serializable in that class? would it be...public class UserData
implements java.io.Serializable extends UserORpublic class UserData extends
User implements java.io.SerializableThanks in advanceChristo
Eric A. Maginniss - 18 Apr 2006 01:44 GMT
> as part of a project at uni i have been asked to provide object persistance
> through files
[quoted text clipped - 23 lines]
> implements java.io.Serializable extends UserORpublic class UserData extends
> User implements java.io.SerializableThanks in advanceChristo

Serialization is about converting objects into Streams of
reconstitutable data.  What you do with the stream is up to you.  Also,
once a class implements an interface all subclasses automatically
implement it.

Java API Javadocs are your friend:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/ObjectOutputStream.html

Another thing to look up is the java keyword "transient"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.