Wednesday, February 24, 2016

What is volatile keyword in java ?

volatile is a keyword in java it is used to indicate java compiler and java thread that do not cache the value of the variable preceded with the volatile keyword and all time read the volatile variable's value from the main memory. 

So whenever you want read and write operation to be atomic on any variable then declare that variable with volatile keyword.

also take a look at what is transient in java

No comments:

Post a Comment

Scrum and Scrum master

Scrum  Scrum is a framework which helps a team to work together.  It is like a rugby team (the scrum name comes from rugby game). Scrum enco...