Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@anoop-kumar-GDGRCn • Sep 12, 2013
never used volatile variables in real project.
you can see some stackoverflow discussion, they have some practical examples
#-Link-Snipped-#
This discussion is very clear why volatile
#-Link-Snipped-# -
@dhaval-pujara-LGoZAW • Sep 15, 2013
volatile modifier tells the JVM that a threbad accessing a the variable must always reconcile its own private coppy of the variable with master copy in memory ......ALL IN ONE THAT STOP ACCESSING MULTIPLE THREAD TO INSTANCE VARIABLE VOLATILE IS USED ultimatly its only applied to instance variable not local variable