Hi,
This is one of the questions from Dan's mock exam
The answer to the question is given as "ABC" and I got the same answer after executing
But I am still unable to understand.
The variables sa's declared in class A and class B are different. In class B the synchronisation is done on static variable of B. while in class A it is on A.sa. Then why will the
thread t1 wait for the synchronisation on sa(of class B) to complete before entering in to the synchronisation block of sa(of class A) .
And also how will the sa of class A get the values {a,b,c} when it is assigned to {x,y,z}. After assignment there is no direct refernce of sa(of B) to sa(of A)
Please help me understand this.
Thx
Sharanya
Edited by Corey McGlone: Added CODE Tags
[ August 05, 2004: Message edited by: Corey McGlone ]