DEVFYI - Developer Resource - FYI

Can Java object be locked down for exclusive use by a given thread?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

35. Can Java object be locked down for exclusive use by a given thread?

Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.

(Continued on next question...)

Other Interview Questions