Home > DeveloperSection > Interviews > What is volatile Keywords in Java ?

Posted on    July-04-2015 1:55 AM

 Java Java 
 1 Answer(s)
  648  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    July-04-2015 1:55 AM

Volatile keyword is used to indicate the threads using a common variable that, the variable which is declared as Volatile can be updated by multiple threads. So threads should not cache the threads locally and in turn should get the value for the variable from main memory. 
If a variable is declared as volatile, it won't be serialized.

Don't want to miss updates? Please click the below button!

Follow MindStick