Sunday, 15 January 2017

What is volatile keyword in Java?

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

No comments:

Post a Comment