J
James Yong
Hi,
Let say I have a method in a helper class that is used throughout my java
project. This method changes a string value to empty if it has a null value.
public final String emptyStringIfNull(String a)
{
return a==null?"":a;
}
Would it be better to make this mathod to be static and synchronized?
On one hand, I am worry about the trade off in the slowdown caused by
synchronization..
On the other, I find it a sore to always to instantiate the helper class.
What are your views on it?
Regards,
James Yong
Let say I have a method in a helper class that is used throughout my java
project. This method changes a string value to empty if it has a null value.
public final String emptyStringIfNull(String a)
{
return a==null?"":a;
}
Would it be better to make this mathod to be static and synchronized?
On one hand, I am worry about the trade off in the slowdown caused by
synchronization..
On the other, I find it a sore to always to instantiate the helper class.
What are your views on it?
Regards,
James Yong