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
What is the symbol for average?
What is the vector class in java programming?
Write a program based on Java script program.
Explain naming conventions for packages?
What do bitwise operators do?
Can arraylist hold different types java?
How do you square a number in java?
What is thread safe singleton?
How java uses the string and stringbuffer classes?
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
What is a lambda expression ? What's its use ?
Are maps ordered java?
What is valid keyword in java?
What is a dynamic array java?
What is the purpose of static keyword in java?