This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Java in General and the fly likes thread safe class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "thread safe class " Watch "thread safe class " New topic

thread safe class

Shrawan Bhageria
Ranch Hand

Joined: Jun 20, 2005
Posts: 52
Dear All,

Please let me know

How i make class thread Safe like Vector class.


Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Hi cowboys,

you have to synchronize all methods that manipulate members of that class.
But this is only a very brief answer, your question implies to much to be answered in a forum in my opinion.
Have a look at CHAPTER 17
Threads and Locks
of the language specification:


all events occur in real time
I agree. Here's the link:
subject: thread safe class
It's not a secret anymore!