Friday 4 September 2015

What is volatile keyword in Java?

When we use volatile keyword with a variable, all the threads read it’s value directly from the memory and don’t cache it. This makes sure that the value read is the same as in the memory.

No comments:

Post a Comment