aspose file tools*
The moose likes Java in General and the fly likes Is properties in java synchronized? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Is properties in java synchronized?" Watch "Is properties in java synchronized?" New topic
Author

Is properties in java synchronized?

Thennam Pandian
Ranch Hand

Joined: Oct 11, 2005
Posts: 163
We know that the Properties class is a sub-class of Hashtable. So all the inherited method are synchronized.
What about the Properties own method like load , store ... etc
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Inside the JDK folder there is a file called src.zip. This contains the source for most of the classes in the API.

But let me save you the trouble of looking it up. Most public methods are synchronized. The store methods aren't, but they use synchronization internally. getProperty also isn't synchronized but it uses super.get which is synchronized. All in all, the API says
This class is thread-safe: multiple threads can share a single Properties object without the need for external synchronization


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Is properties in java synchronized?
 
Similar Threads
can i define a native method in an interface??
Can Overloaded method be synchronized
Thread-safe Action class ?
Interface with strictfp
Doubt in Interfaces