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
What is the constructor?
What does next mean in java?
How to make a read-only class in java?
How to compare two strings in java program?
what is aggregation in java?
How many bytes is a char in java?
What is contract between hashcode and equal method?
explain what is transient variable in java?
what do you understand by synchronization? : Java thread
How an object is serialized in java?
What is the difference between exception and error in java?
Where are global variables stored?
Can a class have multiple constructors?
What are the different types of sorting in java?
What is default constructors?