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
Difference between overriding and overloading in java?
How do you get length in java?
What is nested interface?
Can a static block throw exception?
What is meant by data hiding/encapsulation?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
Can list contain null in java?
How to implement an arraylist in java?
Can we define package statement after import statement in java?
Can you explain the usages of class.forname()?
What is data object example?
What are exception handling keywords in java?
how would you implement a thread pool? : Java thread
Explain differences between checked and unchecked exceptions in java?
What is the point of java?