Showing posts with label volatile modifier. Show all posts
Showing posts with label volatile modifier. Show all posts

Java- volatile modifier / Chapter -10 / Access Modifier




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.



Java- volatile modifier / Chapter -10 / Access 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 keep 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.

Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com