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
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
What is return data type?
What are the different data types in java?
Does substring start with 0?
How do you declare a destructor in java?
How do you end a program?
How do you reverse a word in java?
what is the difference between thread and runnable types? : Java thread
how to create constants in java?
Difference between start() and run() method of thread class?
What is a constructor overloading in java?
What is factor r?
What is empty list in java?
Can a list be null in java?
What are the common uses of "this" keyword in java ?