why to use transient variables when static variables can be
used for Serialization

Answer Posted / priyanjan

static variables can also serialized but is a very
cumbersome process. Transient keyword prefixing any
variable states that the varible does serialized but its
state i.e. value of the varible, does not serialize.

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is singleton set an interval?

623


What do you understand by final value?

682


can used Protected Class outside Function.?

706


How to create a custom exception?

644


Can we override static methods in java?

662






When should I use a singleton?

664


What is the loop in java?

672


Why java is a platform independent? Explain

639


What is an enumeration?

646


What modifiers are allowed for methods in an interface?

747


How do you remove an object from an arraylist in java?

544


What is a class in java?

687


How the metacharacters are different from the ordinary characters?

648


What is the difference between synchronized and synchronized block?

612


How does hashmap work in java ?

625