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 does ide stand for?
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
Are arrays classes in java?
What is the importance of main method in Java?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
What is consumer in java?
What is the main purpose of java?
Difference between static and dynamic class loading.
What about instanceof operator in java?
What is token in java?
What are the differences between getting and load method?
Explain the reason behind ending a program with a system.exit(0)?
Can a constructor call the constructor of parent class?
How to store image in arraylist in java?
Is java type safe?