my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Synchronized keyword Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Synchronized keyword" Watch "Synchronized keyword" New topic

Synchronized keyword

Sanjeev BhimaRao
Ranch Hand

Joined: Jul 17, 2006
Posts: 71
Can a synchronized keyword be applied only to methods?

Can a .java file have multiple private/protected classes?

Matthew Brown

Joined: Apr 06, 2010
Posts: 4343

Try it out, see what happens. That's the best approach when you don't know what is possible.
I agree. Here's the link:
subject: Synchronized keyword
Similar Threads
Don't you get a deadlock in this example?
if synchronized keyword was not there in java how to implement it
volatile keyword
why this error