![]() |
What is volatile modifier? |
[Edit] |
[Edit]
In C, C++, and Java, the keyword "volatile" instructs the Java Virtual Machine (VM) not to assume that the value of a variable in memory isn't changing, even during code that isn't apparently changing the value of the variable. This prevents certain optimizations from happening (for example, using a register to temporarily replace the variable).
First answer by Avir. Last edit by Avir. Contributor trust: 64 [recommend contributor]. Question popularity: 9 [recommend question]




