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
How to instantiate static nested classes in java?
When should I use singleton pattern?
How will you initialize an Applet?
What is mean by encoding?
Write a program to print the pattern given below
How many techniques can be employed to create a string object?
Does java allow default arguments?
What is static and final keyword in java?
What do you mean Abstraction in java?
What is a variable and constant?
How do you read a char in java?
Can you make a constructor final in Java?
What is Java Shutdown Hook?
What is fail fast in java?
Can a class extend 2 classes in java?