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
Does constructor creates the object ?
What will happen when using pass by reference in java?
What is Gang of four design patterns
What are the differences between path and classpath variables?
How can we find the sum of two linked lists using stack in java?
Explain importance of inheritance in java?
What is difference between public static and void?
Write java program to reverse string without using api?
Difference between static and dynamic class loading.
What do you mean by pointer value and address?
What is toarray method in java?
What are latest features introduced with java 8?
How do you sort in ascending order in java?
Explain java heap space and garbage collection?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?