This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

volatile  RSS feed

 
Gopal Krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
this is gopal and i am new to Java.
any body plz tell me the purpose of Volatile Modifier eith an easy example

thanks in advance

[ December 05, 2005: Message edited by: Gopal ]
[ December 05, 2005: Message edited by: Gopal ]
 
Naveen K Garg
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gopal,

Please take a look at the following:

http://cephas.net/blog/2003/02/17/using_the_volatile_keyword_in_java.html

It explain everything about volatile keywords in java.

Naveen
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good rule of thumb for new Java programmers and volatile: don't use it!
I've seen too much code like this, using volatile variables, without further
synchronization:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!