hi to all. well can you please tell me that why String class
is immutable?
Thanks in advance.
Answer Posted / hari
Well it is immutable because of the memory concern. For
every new string if there is new object then it will take
lot of memory and if there is such requirement then there
is StringBuffer class provided.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
Explain listiterator and methods in listiterator?
What is early binding and late binding in java?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
Does java vector allow null?
What is the function of log?
Distinguish between a predicate and a function?
Why is stringbuffer not immutable?
How static variable work in java?
What is the difference between inner class and nested class?
How do you change an int to a string?
Can we assign null to double in java?
When will we prefer to use set and list in java and why?
What is parameters example?
Is array passed by reference in java?