File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 42263
    
  64
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 - my free Android networking tools app
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