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 method 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 method" Watch "synchronized method" New topic

synchronized method

Soumy Kumar
Ranch Hand

Joined: Nov 02, 2004
Posts: 78

I thought the answer was 4 but its mentioned 3 ...
can anyone clarify ??

SCJP 1.4<br />" Something is difficult doesn't mean you shouldn't try, it only means you should try harder "
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
I understand "mutually exclusive" to mean that if you hold one lock, no thread can hold the other lock. This is not true of any locks in Java 1.4.

The correct answer is 3:
"The class wide lock and the instance lock being independent of each other."

Mike Gershman
SCJP 1.4, SCWCD in process
Rubel Ahammad

Joined: Feb 05, 2005
Posts: 19
mike is right.
static synchronized methods are independent of instance synchronized methods.

rubel ahammad<br /> <br />SCJP 1.4 (91%)<br />SCWCD 1.4 (Preparing)
I agree. Here's the link:
subject: synchronized method
jQuery in Action, 3rd edition