File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Thread safe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Thread safe" Watch "Thread safe" New topic

Thread safe

jaiser roney

Joined: Jul 15, 2009
Posts: 16
Hi All,

How can we make a method thread-safe (but in terminology we are talking about classes as thread safe) by declaring it as static, i know about synchronized concept but is it possible to make thread safe with only static key word.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Declaring a method as static has no impact on its thread-safety (or thread-unsafety); that's determined by what the method does with data structures that represent shared state.
I agree. Here's the link:
subject: Thread safe
It's not a secret anymore!