why to use transient variables when static variables can be
used for Serialization
Answer Posted / lenina
only non static and non transient variables can be serialized.
if we want a variable to be instance variable,but the
variable is non serializable variable, then we declare that
variable as transient. here exactly we can make use of
transient.
| Is This Answer Correct ? | 26 Yes | 7 No |
Post New Answer View All Answers
Does treeset use compareto?
Can we have 2 main methods in java class?
What are disadvantages of java?
What is the difference between menuitem and checkboxmenu item?
What is method overloading with type promotion?
Can we use both this () and super () in a constructor?
What is the file extension for java?
Is 64bit faster than 32 bit?
What is the lifetime and scope of a variable?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
How to sort elements in a parallel array in java?
What are the main differences between notify and notifyAll in Java?
What is a literal coding?
What is difference between static and abstract class?
Is it possible to use string in the switch case?