In these examples the Code is NOT synchronized,
December 22, 2008 at 9:16 PM
Please consider the fact that the above to examples does not show proper synchronization due to the fact that there are two share objects and hence there are two share Object locks. So thread one and thread two can mix up together.
A way to avoid this would be to make the display method "static" and making it a method that would be shared by all instances, and not having their own copy of it
View All Comments
| View Tutorial