aspose file tools
The moose likes Java in General and the fly likes Transient and Static Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Transient and Static " Watch "Transient and Static " New topic
Author

Transient and Static

Ashok Srinivasan
Greenhorn

Joined: Jun 24, 2004
Posts: 15
While Serializing the object, we cannot able to serialize the static and transient data member. what is the use of transient data member in this case,while both static and transient data members are non-serializable one.
I want clear picture from all.
Gaurav Saxena
Greenhorn

Joined: May 28, 2002
Posts: 29
Hi Ashok
This is what the definition of transient says -
"Transient instance fields are neither saved nor restored by the standard serialisation mechanism". So if at all u want some field to be serialized dont make it as transient/static in the first place.
Hope it clears ur doubt
Gaurav


Gaurav Saxena<br />Programmer Analyst<br />Portland, Oregon
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Transient and Static
 
Similar Threads
static transient member variable
transient modifier - Q25 of Kumar Majji
can u help me ?
Serialization of references
Transient static variables