WHAT IS VOLATILE KEYWORDS IN JAVA ?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 712  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    What is volatile Keywords in Java ?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!