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
Why stringbuilder is not thread safe?
Is vector ordered in java?
Define an applet in java?
How do you sort a string in java?
What is a list in java?
How can you make a class serializable in java?
Define nashorn in java8.
What is a nested class?
What are runtime exceptions?
What do you mean by chromounits in java8?
Is singleton thread safe in java?
Explain a few methods of overloading best practices in java?
Can you give names of Container classes?
Why do we need singleton?
In how many ways we can do exception handling in java?