Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

modifiers

 
rajesh ramalingam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why cannot a variable be final and volatile?
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
volatile specifies some subtleties about the order of modifying and accessing a field in multithreaded environments, but since a final field never changes value the access order doesn't really matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic