aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread Lock 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 "Thread Lock" Watch "Thread Lock" New topic
Author

Thread Lock

Mohit Agarwal
Ranch Hand

Joined: Mar 30, 2004
Posts: 88
class A{
static void synchronized void call() {
}
synchronized void call(){}
}

One lock will be needed for the class and also a lock is needed for the instance when invoking call().

Are they independent of each other or mutually exclusive?

Mohit Agarwal
Would Be SCJP.

"The will to win is worthless if you do not have the will to prepare"
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
They are independent locks. By the way your code will not compile for two reasons. Can you see them?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread Lock