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 methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "synchronized methods" Watch "synchronized methods" New topic

synchronized methods

Sasikanth Malladi
Ranch Hand

Joined: Nov 04, 2000
Posts: 175
All, if a synchronized method calls a non synchronized one, I think the guarantee of only thread accessing the method won't extend to the non-synchronized one. Am I right?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
There are scenarios where you could have multiple threads access the unsynchronized methods, but no other thread would use the unsynchronized method from within the synchronized method until it obtained a lock on the object.
I agree. Here's the link:
subject: synchronized methods
It's not a secret anymore!