> From: "Riley, Cameron" <[EMAIL PROTECTED]>
>
> Scott,
>
>> You should never go
>> new String("xxx")
>> The following works fine
>> (Object) "xxx"
>
> Bathurst burs or farmers friends, they end up on the heap either way. For
> the purpose of the example I wanted to make it plainly obvious that it was a
> String object that was being cast to it's parent.
>
> Cameron Riley
Cameron,
I was simply passing on some very good advice from Effective Java (Joshua
Bloch): "Item 4: Avoid creating duplicate objects"
String s = new String("silly"); // DON'T DO THIS!
The correct version being:
String s = "No longer silly";
Effective Java is an excellent book - I highly recommend it.
Cheers,
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
--
To unsubscribe, e-mail: <mailto:turbine-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@;jakarta.apache.org>