Forums Register Login

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

+Pie Number of slices to send: Send
do we serialize static variables in java ???

if yes...,

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

thanks
regards
raja
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
Just use a java.io.ObjectOutputStream and store them in a file
+Pie Number of slices to send: Send
thanks a lot wounter and ulf
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 767 times.
Similar Threads
Serailzable Problem....
partial serialisation...
Java Serialization: Static Member Variables
Serialization in java
Serialization
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:09:19.