Author
what is volatile?
deepak kushwaha
Ranch Hand
Joined: Jul 17, 2010
Posts: 33
i have see a question that say can a method be declared volatile. what that mean?
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
Volatile only applies to static and instance fields, and it means that the value will never be cached. As a result, all threads will always use the most up-to-date value.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Tom Reilly
Rancher
Joined: Jun 01, 2010
Posts: 618
Here's a topic that discusses volatile .
Arun C. Giridharan
Ranch Hand
Joined: Jul 11, 2010
Posts: 96
ok,so if i have to assign multiple value for my attribute(state) ...how to do it???
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Jul 18, 2010 10:32:33
0
Arun Giridharan wrote: ok,so if i have to assign multiple value for my attribute(state) ...how to do it???
What?
deepak kushwaha
Ranch Hand
Joined: Jul 17, 2010
Posts: 33
thanks tom
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
Probably best moved as too difficult for "beginning"
subject: what is volatile?