string is immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?
Answer Posted / ashish balhara
The performance for String is poor as compared to String
Buffer, as internally (for eg. a simple operation like + on
String), it generates String Buffer, calls append operation
(eqvt. of + in String) & converts result back to String.
Hence extra bytecode is generated which could be done away
with.
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
How to compare two strings in java program?
Is string thread safe in java?
Why for each loop is used?
What is the class in java?
What is static and final keyword in java?
Can list be final in java?
Difference difference paint() and paintcomponent()?
Is empty list java?
Can static methods be inherited?
What are the supported platforms by java programming language?
What is finalize method?
What are structs in java?
Is java a software?
Write a function to find out longest palindrome in a given string?
What are the high-level thread states in java programming?