CAN JAVA OBJECT BE LOCKED DOWN FOR EXCLUSIVE USE BY A GIVEN THREAD?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 775  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!