What are Transient and Volatile Modifiers?

Answer Posted / janet

Transient: The transient modifier applies to variable only
and it is not stored as part of it's objects persistent
state.Transient variables are not serialized.
Volatile: Volatile modifier applies to variables only and
it tells the compiler that the variable modified by
volatile can be changed unexpectedly by other parts of the
program.

Is This Answer Correct ?    22 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps in the jdbc connection?

746


How java enabled high performance?

773


What is a string what operation can be performed out with the help of a string?

717


What is the program compilation process?

753


What is io stream in java?

709






worst case complexities of Quick sort and Merge sort.

772


how can you take care of mutual exclusion using java threads? : Java thread

782


Is it possible for yielded thread to get chance for its execution again ?

751


What is the locale class in java programming?

719


explain the concept of virtual method invocation in polymorphism in detail?

1913


Why we used vector class?

804


Is void a data type in java?

704


What is boolean data type in java?

739


When should a function throw an exception?

784


Will the jvm load the package twice at runtime?

797