State true or false :- The word synchronized can be used with only a method.

A) False
B) True

Showing Answers 1 - 6 of 6 Answers

mavrick_joe

  • Apr 19th, 2006
 

Synchronized is used to synchronize an OBJECT. So, answer to this is false since we can use it for a method, that would synchronize "this" object or we can use it for a perticular object in a class.

  Was this answer useful?  Yes

False, because synchronized keyword is used as block also.
Ex:
synchronized blocks can lock within code for just a few instructions and on any object whatsoever:

  synchronized (anyObject) {      // .. object is handled atomically here   } 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions