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


Please Help Members By Posting Answers For Below Questions

Which is faster string or stringbuilder?

521


Can I uninstall java?

555


What is java dot?

498


What are the advantages of autoboxing?

539


What is the generic function?

528






What is a Null object?

892


How do you achieve singleton?

534


What is a method declaration?

517


What is hash code collision?

593


Is java a prime method?

553


What is difference between static and abstract class?

523


Which number is denoted by leading zero in java?

814


What is float in java?

565


How do you implement tree mirroring in java?

597


How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?

759