What are the two main uses of volatile in Java?
Answer / Vitesh Kumar
Volatile is used to ensure that the changes made to a variable by one thread are immediately visible to other threads, and it also ensures that the Java compiler does not optimize away certain operations like looping.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between logical data independence and physical data independence?
What is the use of default method in interface in java?
what happens when a thread cannot acquire a lock on an object? : Java thread
What is a locale?
Explain about public and private access specifiers?
Can we declare main () method as non static?
how an we achive multiple inhetitance in java using interface..??
Can we call a non-static method from inside a static method?
where exactly collections are usefull in realtime
How does map works in java?
What is a substitution variable?
What is vector?