Organizational Research By

Surprising Reserch Topic

Transient vs Static variable java


Static Variable

Static variables belong to a class and not to any individual instance. The concept of serialization is concerned with the object’s current state. Only data associated with a specific instance of a class is serialized, therefore static member fields  are ignored during serialization.

Transient Variable

While serialization if you don’t want to save state of a variable. You have to mark that variable as Transient. Environment will know that this variable should be ignored and will not save the value of same.

asked Sep 1, 2015 in Core java by rajesh
edited Sep 1, 2015 by rajesh
0 votes
71 views



Related Hot Questions



Government Jobs Opening


...