8
votes
2answers
559 views

Is it time to deprecate synchronized, wait and notify?

Is there a single scenario (other than compatibility with ancient JVMs) where using synchronized is preferable to using a Lock? Can anyone justify using wait or notify over the newer systems? Is ...
5
votes
3answers
968 views

When should I use StringBuilder or StringBuffer?

In a production web application, my fellow programmers used StringBuffer everywhere. Now I am taking care of application development and corrections. After reading StringBuilder and StringBuffer I ...
2
votes
1answer
251 views

How to achieve thread synchronizing without effecting the efficiency in java [closed]

Say using following function: public synchronized int getUnique(){ MyObject obj = getValueFromDb(); obj.modifyIt(); obj.commit(); } When simultaneous call is made to this method several ...