File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Threadsafely of variables. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Threadsafely of variables." Watch "Threadsafely of variables." New topic

Threadsafely of variables.

Siddharth Purandare
Ranch Hand

Joined: Nov 13, 2006
Posts: 101
Hi All,

I was reading the thread safety of variables when we implement the SingleThreadModel interface and when we don�t implement the SingleThreadModel interface. The final conclusion is that only the request time variables and the local variables are thread safe and no other variables. That�s fine with me, no issues in that.

My doubt is that is that � Is StringBuffer variables thread safe irrespective of their position and irrespective of whether the class implements SingleThreadModel�??? (As the StringBuffer Class objects are threadsafe by default). Please clarify if I am wrong to interpret something.

Thanks in advance.
[ December 07, 2006: Message edited by: Siddharth Purandare ]

Siddharth Purandare<br />SCJP 1.4 - 76%<br />SCWCD 1.4 - 85%<br /> <br />It is the "attitude" and not the "aptitude" which determines "altitude".
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 549

ok, this is a redundant question.
Like I said before, SingleThreadModel is deprecated and no longer on the exam so you can forget about it.

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
I agree. Here's the link:
subject: Threadsafely of variables.
It's not a secret anymore!