| 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
|
 |
 |
|
|
subject: Regarding serialization process
|
|
|