why String class is immutable.

Answer Posted / vikrant

Once a string object is created no changes can be made to
it. If a string is modified in code a new object will be
created. That is why string is immutable

Is This Answer Correct ?    24 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the enableevents() method?

791


What is instance means in java?

790


What is a class object?

699


Whats the difference between notify() and notifyall()?

793


Why is the type for real numbers called double?

731


What are the differences between include directive and include action?

771


Can we use String with switch case?

868


Can arraylist contain null values?

760


What are the new features in java 8?

803


What is string syntax?

809


Why is string buffer better than string ?

800


What is complexity in java?

744


When do we use synchronized blocks and advantages of using synchronized blocks?

896


What does localhost mean?

702


What is nested top-level class?

778