string is immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?
Answer Posted / payal gupta
It is an advantage that a String class is immutable because
almost all the standard classes use its methods, if they
were mutable, then the behaviour of other standard classes
and their methods would not have been consistent.
| Is This Answer Correct ? | 7 Yes | 7 No |
Post New Answer View All Answers
Why is string builder not thread safe?
How does regex work?
Difference between character constant and string constant in java ?
Is set ordered in java?
can java object be locked down for exclusive use by a given thread? : Java thread
Is static a keyword in java?
What are the steps involved to write rmi based programs?
What is use of inner class in java?
Do I need java for windows 10?
Can we write class inside a class in java?
What is the replace tool?
Explain when classnotfoundexception will be raised ?
What is intern method in java?
Which one of the following suits the description of a string better: derived or primitive?
How transient variable is different from volatile variable?