Synchronization hits panelty on performance so when you want to only some portion of you method code synchoronized in that case use synchronized statement in you method. Otherwise if you wish whole your method synchronized use synchronized method.
Category:Java Interview Questions
No comments:
Post a Comment