This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes please help me on how to serialise static variables, if possible 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 "please help me on how to serialise static variables, if possible" Watch "please help me on how to serialise static variables, if possible" New topic
Author

please help me on how to serialise static variables, if possible

raja pulleboina
Greenhorn

Joined: Dec 10, 2009
Posts: 12
do we serialize static variables in java ???

if yes...,

please let it publish her how to serialize static variables in java ...

thanks
regards
raja
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35249
    
    7
Static fields are part of the class, not of any instantiated object of that class, so they're not saved if an object is serialized. Does that answer your question?


Android appsImageJ pluginsJava web charts
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Just use a java.io.ObjectOutputStream and store them in a file


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
raja pulleboina
Greenhorn

Joined: Dec 10, 2009
Posts: 12
thanks a lot wounter and ulf
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: please help me on how to serialise static variables, if possible
 
Similar Threads
Java Serialization: Static Member Variables
partial serialisation...
Serialization in java
Serialization
Serailzable Problem....