Blue Jeans Interview Question
Principal Software EngineersCountry: India
when thread t1 is executing on synch method1() and nonsynch method2. it has to acquire a lock on calling object of method1() but not for method2().
say for example: there are two threads t1 and t2. and 3 mothods A(), B() and C();
Method A() and B() are sycnhronized but method C() is not.
So, t1 and t2 both can execute C() without acquiring a lock but they (t1 and t2) need to acquire a lock for A() and B(). Means only one thread can execute A() or B() at a time.
The object upon which the method is being executed.
- zxjcarrot March 21, 2015