why String class is immutable.

Answer Posted / kirthika

everytime a string object is created, it enters into the string pool and thereby this concept was mainly to enhance the response time if the same string is used elsewher..
therefore string class is immutable..

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a functional interface?

549


What is the purpose of main function in java?

541


What is heterogeneous in java?

498


How garbage collection is done in java?

551


What is parameters example?

558






What is an object's lock and which object's have locks in java programming?

571


What are the advantages and disadvantages of reference counting in garbage collection?

579


What is boolean example?

529


Justify your answer that you can't define a method inside another method in java, if you can then how?

606


Why is serialization required?

547


Is string is a data type in java?

593


If you are given the name of the function at run time how will you invoke the function?

690


What is the use of http-tunneling in rmi?

555


Why string is called as immutable?

524


State differences between C and Java?

669