Reagrding Syncronized Block

Hi Gurus

What is the Benefit of Using staticsynchronizedvoid amethod(){}

VS

synchronized void amethod(){}

Help is deeply Appreciated

[324 byte] By [rajpuniaa] at [2007-10-3 8:39:30]
# 1
So, your question has nothing to do with synchronization. You're just asking when to use a static method (class) method vs. a non-static (instance) method.
jverda at 2007-7-15 3:47:37 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

> So, your question has nothing to do with

> synchronization. You're just asking when to use a

> static method (class) method vs. a non-static

> (instance) method.

No I want to know that which is the best way to craete a method which cab be acessed by only one person to craete Id vs Description Map.

rajpuniaa at 2007-7-15 3:47:37 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
Do you mean a method that can be accessed by only one thread at a time? If so, then make the method synchronized. Whether static or non-static is "best" depends on details of your requirements.
jverda at 2007-7-15 3:47:37 > top of Java-index,Other Topics,Patterns & OO Design...