| Author |
String and Immutability
|
Gourav Prat
Greenhorn
Joined: Jul 12, 2005
Posts: 9
|
|
By using Replace method of String we can change a string content. But string is immutable.So how this thing can be explained?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
You are creating a new String object by using any method which might suggest a String was anything other than immutable (such as replace()). (By the way - this might have been better posted in the Java In General (Beginners) forum, since it doesn't really have anything to do with performance). [ July 12, 2005: Message edited by: Paul Sturrock ]
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24050
|
|
|
Moving to Java in General (Beginner).
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: String and Immutability
|
|
|