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
Is string passed by reference in java?
What is the static block?
What do you understand by the bean persistent property?
What is internal iteration in java se 8?
How many java versions are there?
What is regex used for?
Does java vector allow null?
How will you serialize a singleton class without violating singleton pattern?
How can we create an immutable class in java?
Is string thread safe in java?
What is static data type in java?
Which sorting is best in java?
What is the concatenation operator in java?
What is object cloning in Java?
What is a stringbuilder?