aspose file tools
The moose likes Beginning Java and the fly likes Regarding serialization process Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Regarding serialization process" Watch "Regarding serialization process" New topic
Author

Regarding serialization process

surya.raaj prakash
Ranch Hand

Joined: Oct 30, 2009
Posts: 76
Hi Friends,

I have the class that implements serializable interface,in that i declared 100 variables but i want to save only one variable.
can i declare transient to remainig 99 variables to skip from serialization process?
Rok Ć telcer
Ranch Hand

Joined: Nov 03, 2009
Posts: 101
Sure.


SCJP, SCWCD
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 341
Remember transient instance variable brought back as null when deserialize and you need to initialize those instance variable with some default (or original) values otherwise you can suffer with NullPointerExceptions.


http://muhammadkhojaye.blogspot.com/
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Cool. i dont know about your requirement. but when you say "serialization" ,should careful. google for "serialization proxy pattern".it may useful to you
surya.raaj prakash
Ranch Hand

Joined: Oct 30, 2009
Posts: 76
Hi Friends,
Thanks For Your Replies.

But still I'm not getting the solution
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding serialization process
 
Similar Threads
interview question of the day (08/04/2008)
my static int is serialized, WHY?
Does private instance variable participate Serialization process?
serialization
Serailzable Problem....