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.

Saving Serialized objects

Thread view: 
Christo - 23 Apr 2006 22:01 GMT
ok i need serious help

Im using this as a basic example

lets say i have a class

public class AddNum implements Serializable
{
   public int mCount;

   AddNum()
   {
       mCount = 0;
   }

   public void Add()
   {
       mCount++;
   }
}

how can i save an object of this class utlizing serialization in the
process?

i have tried for almost a week now on my own and i am serously struggling

any help would be great

TIA

Christo
Grzegorz Kaczor - 24 Apr 2006 07:12 GMT
> ok i need serious help
>
[quoted text clipped - 19 lines]
> how can i save an object of this class utlizing serialization in the
> process?

Use ObjectOutputStream.
But please note one thing: If you have a network of objects, every one
referencing some others, and you serialize all the network, every object
will be saved only once in the stream. This can be sometimes annoying.

Best Regards,
Grzegorz Kaczor


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.