Re: why String s = new String("test") is bad?
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 31 Oct 2008 02:47:48 -0700
On Thu, 30 Oct 2008 10:59:40 -0700 (PDT), Steve <javacc2@xxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
I always wonder why String s = new String("test") is bad?
We always do String s = "test" instead. Why?
Please help explain. thanks!!
see http://mindprod.com/jgloss/newbie.html
http://mindprod.com/jgloss/string.html
The first creates a duplicate string object, wasting RAM.
--
Roedy Green Canadian Mind Products
http://mindprod.com
A vote for McCain is fearful clinging to McSame.
A vote for Obama is a shot at Obamalot.
.
- References:
- why String s = new String("test") is bad?
- From: Steve
- why String s = new String("test") is bad?
- Prev by Date: Re: How to set the compiler to handle thousand loops ?
- Next by Date: Re: Unexpected type error
- Previous by thread: Re: why String s = new String("test") is bad?
- Next by thread: e books and software downlodes
- Index(es):
Relevant Pages
|