the question below was asked me in one of the interview.
And i just want to make sure if my understanding is correct or not.
Now here, if the Student class has 2 Threads of Same instance.
and call is made by them, say Thread1.getId() and Thread2.getSub()
Will it work ? Will both methods will get called ?
My understanding is, at a time one instance can have one lock.
But want to know how does it operate when we have 2 threads of same instance
for two different synchronized methods ?
Hope, i am clear with my question.
please let me know if you want further details on it.
Also, if any one can explain me in detail with sample,
how it works in polymorphism that would be awesome !!
My concepts of threads are weak, and i need some what more understanding in that !!
Thanks in Advance !!