volatile keyword in java

The “volatile” keyword can be used to indicate that, a member variable that can be modified asynchronously by more than one thread. In other words, When a volatile variable is accessed concurrently by multiple threads, its value is updated consistently among all the threads and hence all the threads share the same value for volatile […]

Share this article on