This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Beginning Java
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
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
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?
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://aspose.com/file-tools
 
subject: please help me on how to serialise static variables, if possible