Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes synchronized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "synchronized" Watch "synchronized" New topic


josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
can i use synchronized keyword with ordinary methods
that do not involve threads.If so i want a small example
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
Yes you can. And synchronized methods can be used in a NON-threaded environment. It would be a waste but still...
An example? Put the word "synchronized" in front of any method.

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link:
subject: synchronized
jQuery in Action, 3rd edition