aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
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?


Ping & DNS - updated with new look and Ping home screen widget
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
 
Similar Threads
Serialization
Serailzable Problem....
Java Serialization: Static Member Variables
partial serialisation...
Serialization in java