File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Elasticsearch in Action this week in the Big Data 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: 4517

Try it out, see what happens. That's the best approach when you don't know what is possible.
It is sorta covered in the JavaRanch Style Guide.
subject: Synchronized keyword