Wednesday, February 13, 2002 08:10 PM
If ur method does two operations ex PUT & GET from
the Collection then, even though the two methods PUT & GET
are synchronized, but ur actual method is not.
So it is possible that 2 threads are in ur method at a time
One trying to PUT and another trying to GET.
So even though Vector and HashTable are synchronized
they do not help in the situation described above .
Coz the synchronization is on methods,i.e the thread is restricted
for that block of code only.
See if ur method(or the object) needs to be synchronized after reading this.
And let me know if my answer helped.