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 synchronized? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "synchronized?" Watch "synchronized?" New topic


Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
What return type is synchronized of the function?
public synchronized void reset()
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Synchronized is not a return type, it is a modifier saying that a Thread calling this method obtains a lock, causing all other Threads trying to access that object's synchronized methods to wait until the current thread is done.
Do a search on "synchronized" for more information, or read any Java book you have available to you.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

The synchronized keyword marks a critical section. It is not a return type. Read more about in the Java Tutorial:
[This message has been edited by JUNILU LACAR (edited December 19, 2001).]

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: synchronized?
It's not a secret anymore!