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
How does varargs work in java?
Why can't we override private static methods?
What is equals method in java?
Explain method local inner classes ?
Is set thread safe java?
What is jpa specification?
What is string and its types?
What is appletviewer?
What is http client in java?
What is lazy programming?
What is unicode datatype?
Explain the difference between map and flatmap stream operation?
what is thread? What are the high-level thread states? : Java thread
Why char array is favored over string for the storage of passwords?
How do you sort a string in java?