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


Please Help Members By Posting Answers For Below Questions

How does varargs work in java?

615


Why can't we override private static methods?

523


What is equals method in java?

527


Explain method local inner classes ?

597


Is set thread safe java?

504






What is jpa specification?

539


What is string and its types?

616


What is appletviewer?

576


What is http client in java?

523


What is lazy programming?

571


What is unicode datatype?

533


Explain the difference between map and flatmap stream operation?

823


what is thread? What are the high-level thread states? : Java thread

794


Why char array is favored over string for the storage of passwords?

561


How do you sort a string in java?

541