Ron Reynolds wrote:
>
> i believe you have to allocate your Stings when you're adding them to
> the hash table, don't you? i.e.:
> hTable.put(new String("1"), new String("Premiere chaine"));
>
> i've been doing this and haven't had any problems (yet) with hash
> tables. if this is incorrect please, someone, let me know.
It's not so much incorrect as unnecessary. The literals "1" or "Premiere chaine"
are already String objects so there is no need to call 'new String("...")' to
create a new String object. Using the String constructor is only necessary when
you have something like a char[] that you want to turn into a String.
K Mukhar
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html