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 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: