posted 19 years ago
If I have a class similar to the one below, and have a synchronized block for the object level lock on "_object", will that prevent the getStaticObject() method from returning the "_object", which may be null, if the reinitObject() method is called?
It seems like both methods should be static and synchronized, and the synchronized block should synch on the class level lock... to prevent the getStaticObject() method from returning a null, right?
Which is the best approach to preventing getStaticObject() from ever returning null?
Thanks,
Becker
[ July 07, 2005: Message edited by: Beaker ]