[concurrency-interest] Why String is immutable?

David Holmes dholmes at dltech.com.au
Wed Sep 14 07:39:35 EDT 2005

Primarily for security purposes. It assures that given, for example, a
security check that you can access a file of a given name, that the string
is not concurrently modified to represent a different file between the
security check and the actual opening of the file.

It also makes it easy to share strings without having to worry about someone
accidentally or maliciously changing the string - such as constant values.

David Holmes
  -----Original Message-----
  From: concurrency-interest-bounces at cs.oswego.edu
[mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Bharath
  Sent: Wednesday, 14 September 2005 7:40 PM
  To: concurrency-interest at altair.cs.oswego.edu
  Subject: [concurrency-interest] Why String is immutable?


  Could anyone tell me why String is immutable?

  I Blog at http://jroller.com/page/bharath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20050914/5cceb2d3/attachment.htm

More information about the Concurrency-interest mailing list