I have the following question:
What will happen when the following code is compiled:
The answer is: 123
The reason given is, since run method is synchronized, the start() doesn't trigger run() until the foo() method is completed. But the doubt I had is its the same object, and if you have lock to the object,
you should be able to access all synchronized methods.
Adding to that, when I change the code to the following:
This does print 7
Can someone explain what is going on?