• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is volatile?  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have see a question that say can a method be declared volatile. what that mean?
 
Sheriff
Posts: 21291
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a topic that discusses volatile.
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok,so if i have to assign multiple value for my attribute(state) ...how to do it???
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks tom
 
Marshal
Posts: 58470
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably best moved as too difficult for "beginning"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!