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

Can we use both this () and super () in a constructor?

547


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

552


Can we override the private methods?

519


Does sprintf add a null terminator?

558


what is object slice?

1574






How can you read content from file in java?

597


What is thread count in java?

543


Can we have this () and super () together?

602


What is method and methodology?

608


Can we instantiate interface in java?

670


What a static class can contains?

694


Explain the available thread states in a high-level?

526


How do you use spaces in java?

521


What is the use of toarray () in java?

537


What are the classes of java?

539