Java Volatile modifier
1." volatile" is a modifier applicable only for variable and we can't apply for methods & classes.
2.If a value of a variable keeps on changing by multiple threads then there may be a chance of data inconsistency problem.We can solve this problem by using "volatile modifier".
3.If a variable declared as volatile then for every thread JVM will create a separate local copy.