Answer Posted / subrahmanyam
transient
identifies a variable not to be written out when an
instance is serialized (It can'nt be copied to remove
system)
volatile
indicates that the field is used by synchronized threads
and that the compiler should not attempt to perform
optimizations with it.
When more than one thread share a (volatile) data it is
checked every time. Every thread keeps the latest value of
volatile variable
| Is This Answer Correct ? | 30 Yes | 4 No |
Post New Answer View All Answers
What is getkey () in java?
Differentiate between nested and inner class in java.
What is a condition in programming?
What do you understand by final value?
What is the difference between array list and vector in java?
What is treemap in java?
What is use of functional interface in java 8? Explain
What do you mean by default constructor in java?
Is java se open source?
What do you mean by JVM?
Define an applet in java?
If I only change the return type, does the method become overloaded?
How to create com object in Java?
What is a treeset class?
How transient variable is different from volatile variable?