What would you do?
- From: "James Yong" <james$@i$.com>
- Date: Mon, 26 Sep 2005 15:04:53 +0800
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
.
- Follow-Ups:
- Re: What would you do?
- From: John C. Bollinger
- Re: What would you do?
- From: Bryce
- Re: What would you do?
- From: Gijs
- Re: What would you do?
- From: Roedy Green
- Re: What would you do?
- Prev by Date: moving resources from server.xml into the webapp
- Next by Date: Re: Syncing notebook with desktop, and oh by the way I'm using eclipse.
- Previous by thread: moving resources from server.xml into the webapp
- Next by thread: Re: What would you do?
- Index(es):
Relevant Pages
|