File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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!