Java object-locked down-exclusive use-given thread

Is it possible that Java object can be locked down for exclusive use by a given thread?

E

Expert

Verified

Yes it is possible, you can lock an object by placing it in a "synchronized" block. The locked object is isolated to any thread except the one which explicitly claimed it. If a thread attempts to execute either synchronized method or synchronized statement and is not capable to occur an object's lock, it goes in waiting state until the lock becomes accessible.

   Related Questions in JAVA Programming

©TutorsGlobe All rights reserved 2022-2023.