| Author: vimalraj 10 Jun 2007 | Member Level: Silver | Rating: Points: 2 |
with string you c't do more string operations but with stringBuilder you can do more string operations
|
| Author: vimalraj 10 Jun 2007 | Member Level: Silver | Rating: Points: 2 |
with string you c't do more string operations but with stringBuilder you can do more string operations
|
| Author: vimalraj 10 Jun 2007 | Member Level: Silver | Rating: Points: 2 |
with string you c't do more string operations but with stringBuilder you can do more string operations
|
| Author: victoria 11 Jun 2007 | Member Level: Gold | Rating: Points: 2 |
Hello ss.mmm
using string you cannot make changes to original string ,whenever u do any operation on the string it will create a new copy of the string with the operation done..
like if you are performing upper case operation on string s then it actually creates a new copy of s which is uppercase..
but where as stringBuilder performs operation on the original string directly hence saves much space .. StringBuilder assigns more number of locations for a string then actually required locations so as and when you perform operations on this object the system will resize the objects..
simple answer for your question is string generates immutable object and stringBuilder generates mutable(changable) objects.
|
| Author: Anand 11 Jun 2007 | Member Level: Bronze | Rating: Points: 2 |
1. stringbuilder is mutable and that is why one can use it when large number of string manipulation is
2. needed. where as string is immutable so each time the string is changed a new
3. instance has been created in the memory.
see that link : http://www.heikniemi.net/hc/archives/000124.html
|