Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Help Java V volatile Java Keyword

Related Tutorials


Share on Google+Share on Google+

volatile Java Keyword

The volatile is a keyword defined in the java programming language.

volatile Java Keyword


The volatile is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the volatile keyword indicates the following :

-- The volatile keyword is mostly used to indicate that a member variable of a class may get modified asynchronously by more than one thread.
-- This thing is noticable that the volatile keyword is not implemented in many Java Virtual Machines.
-- The volatile keyword from the side of compiler tries to guarantee that all the threads should see the same value of a specified variable.

Example to use the volatile keyword in a class:

public class Cla


volatile int sharableValue;




If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 12, 2009

Related Tutorials

Discuss: volatile Java Keyword  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
July 1, 2011

you should be give more explanation on volatile key word.