Forums Register Login

Static variable

+Pie Number of slices to send: Send
Dear all,
When are static variables eligible to garbage collection?
thanks
daniel
+Pie Number of slices to send: Send
Static variables are garbage collected when the class they belong to is garbage collected. Classes can only be collected when nothing refers to that class anymore.
kind regards
+Pie Number of slices to send: Send
If the static variable is being used by a number of objects then it is eligible for GC when the last object using it is GC'd.
I think I'll just lie down here for a second. And ponder this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 847 times.
Similar Threads
object creation and garbage collection
Garbage Collection
Brogden's Garbage Collection?
Garbage Collection
Garbage Collection
More...

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