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 string :: npos?
What is difference between final and immutable?
What is floor in java?
What is prefix of a string?
Give example to differentiate between call by value and call by reference.
Differentiate between static and non-static methods in java.
What is the use of arraylist class in java?
Explain a situation where finally block will not be executed?
what is bmg file and how to create that files?what will it contailn?
whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net
What is difference between java and java ee?
How can we create a synchronized collection from given collection?
What is ternary operator in java?
What is meant by anonymous class?
Why does abstract class have constructor?