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

When should I use stringbuffer?

562


Is nullpointerexception checked or unchecked?

549


What are java packages? What is the significance of packages?

559


What do you mean by multithreaded program?

544


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

617






What is use of super keyword in java?

588


What are computer functions?

473


How to check if a list is sorted in java?

580


What is a container in a gui?

535


How do you do a line break in java?

485


What are Normalization Rules? Define Normalization?

541


Does garbage collection occur in permanent generation space in jvm?

591


What are java methods?

564


What is array and arraylist in java?

518


What is the purpose of abstract class?

515