aspose file tools*
The moose likes Java in General and the fly likes what is volatile? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "what is volatile?" Watch "what is volatile?" New topic
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: 19670
    
  18

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 - OCEEJBD 6
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

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: 38348
    
  23
Probably best moved as too difficult for "beginning"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is volatile?