• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

volatile

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how volatile modifier work?
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are posting in the SCJP-Forum, here's what the bible says:

For the exam, all you need to know about volatile is that, as with transient, it can be applied only to instance variables.


Good news?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it really say that? If so, please tell us exactly which book and page number, because that should be reported as an error. The volatile keyword certainly can be used on class variables as well as instance variables. However I doubt you need to know even that much for the SCJP. Volatile really isn't important for that exam.
 
Sasha Ruehmkorf
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from K&B page 59.
Maybe it's already reported? I don't understand this cryptic line in the errata: ".59....x-ref.....Volatile para. s/b: Chapter 9"
 
author
Posts: 9046
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

Let me step back a minute. In general, our idea when writing K&B was to provide candidates with solid foundations in the topics on the exam, and to try to teach about 110% of what's necessary for the exam. Please remember, that if you get 100% on the exam, that doesn't mean you know anywhere near 100% of Java. K&B is in no way a complete rehashing of the Java spec. We think the exam objectives are really good, and we think that if you pass the exam you will understand the important, foundational elements of Java.

That said, what we say in the book is: "For the exam, all you need to know about volatile is that, as with transient, it can be applied only to instance variables."

The key phrase here is "For the exam"

This is not the whole story concerning volatile variables - but it IS what you need to know for the exam.

hth,

Bert
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic