How to check if a thread holds lock on a particular object in Java? Example
Think about a scenario where you would have to find at the run time whether a Java thread has a lock on a particular object e.g. find out whether thread NewsReader has a lock on a NewsPaper object or not? If these questions came in any core java interview then I would automatically assume that there could be at least two answers one is the hard-earned raw answer which programmer would like to figure out based on fundamentals and the other could be some rarely used API calls that are available in Java, by the way, this is actually asked to me in an interview of one of the biggest global Investment bank.
تعليقات
إرسال تعليق