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
Explain about class in java?
Which sorting is best in java?
What is anti pattern in programming?
can I implement my own start() method? : Java thread
What are singleton services?
Are variables stored in ram?
What is a void method?
Can we override compareto method?
What is the purpose of static methods and variables?
Why is the type for real numbers called double?
What are different type of exceptions in java?
What does %d do in java?
What are the concepts of 'OOPS'?
How do you sort in descending order in java using collections sort?
What is the difference between integer parseint and integer valueof?