| |
GeekInterview.com > Interview Questions > J2EE > Java
| Print | |
Question: Can a lock be acquired on a class
Answer: Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.. |
| October 10, 2005 10:35:55 |
#4 |
| abhishek |
J2EE Expert Member Since: October 2005 Total Comments: 8 |
RE: Can a lock be acquired on a class |
Simply Locking a Thread means to do operation only at once you can Lock the Thread by simple put a keywork sychronize in the front of the method. Like Synchronize m1() { } |
| |
Back To Question | |