string is immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?

Answer Posted / chandu

Sting is Immutable.We can make String as mutable in the give ex
String s="Hello";
String s=s1;
String s2;
s2=s1.append("World");

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are methods of a class?

538


Is main is a keyword?

573


When does an object becomes eligible for garbage collection in java?

573


What is hashset in java?

522


What is included in core java?

576






What is the common usage of serialization? What exceptions occur during serialization?

598


What technique can be employed to compare two strings?

567


What are the advantages of inner classes?

505


What ide should I use for java?

487


How many techniques can be employed to create a string object?

551


How can we make sure main() is the last thread to finish in java program?

664


worst case complexities of Quick sort and Merge sort.

595


What do you mean by thread safe?

536


How many bytes is a string java?

525


Can I declare a class as private?

582