Answer Posted / sudhadevi
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 ? | 12 Yes | 2 No |
Post New Answer View All Answers
Which is the class in java?
What is the use of optional ?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
How many characters is 16 bytes?
Differentiate between == and equals().
Give example to differentiate between call by value and call by reference.
Why java strings are immutable in nature?
How to sort a collection of custom Objects in Java?
How to print an arraylist in java?
Is singleton a bad practice?
What is set string?
What is anagram number?
What is memory leak and how does java handle it?
How will you compute size of a structure?
How to perform merge sort in java?