Volatile: In java volatile modifiers is always uncertain and it can be changed unexpectedly in others part of the code. Good example is multithreaded programs where two or more threads share the same variable and each thread could keep its own copy and it could be private copy of a shared variable. The master copy of variable can be updated multiple times such as when it enters to synchronized methods. This approach and thought was good but It can be inefficient at times. All that really matter is master copy of the variable continuously should reflects its current state. To ensure this specify the variable as volatile which will tell the compiler that it should always use master copy of volatile variable (always keep private copies up-to-date with the master copy, and vice versa) and access to master variable should be executed in the precise order where they are executed on any private copy.