Are runtime strings still imutable ?
From: Rob Jones (nospam_at_dontbother.com)
Date: 03/31/04
- Next message: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Previous message: Jeff Schwab: "Re: Is PrintWriter threadsafe?"
- Next in thread: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Reply: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Reply: Jeff Schwab: "Re: Are runtime strings still imutable ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Mar 2004 17:52:32 +0100
Hi all,
Anyone know the details about String immutability ?
I understand the need to have imutable strings at compile time.
However if at runtime I have say 8000 strings and then I make
a new string from an existing string using substring
does that mean that my exisint 8000 strings will be searched
incase I am making a duplicate ?
That seems quite an overhead ?
Equally once I have created this new String once it becomes
eligible for garbage collection will the immutable String
be removed from the immutable string collection ?
IE will I just lose a reference to an immutable String object
or will that immutable String object be resuable for new
String objects that are created to have the same value ?
Does that mean creating/deleting lots of Strings can build
up an unfreeable area of memory ?
Thanks
Rob
- Next message: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Previous message: Jeff Schwab: "Re: Is PrintWriter threadsafe?"
- Next in thread: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Reply: Yoyoma_2: "Re: Are runtime strings still imutable ?"
- Reply: Jeff Schwab: "Re: Are runtime strings still imutable ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|