why String class is immutable.

Answer Posted / rakesh

For save the memory and reduce the response time.
StringBuffer provide an alternet for String class object,
which is muttable.

Is This Answer Correct ?    5 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multithreading in java?

551


Explain wait() method of object class ?

636


Why is a singleton bad?

559


Is singleton a bad practice?

579


How to instantiate static nested classes in java?

566






Which programming language is most secure?

534


Why is stringbuffer thread safe?

568


What is the difference between stringbuffer and stringbuilder class?

574


What is jpa specification?

539


why not override thread to make a runnable? : Java thread

559


How can you traverse a linked list in java?

685


Which is faster call by value or call by reference?

501


What is formatted output?

514


How to display all the prime numbers between 1 and n (n is the number, get the input from user)

515


What is structure of java heap? What is perm gen space in heap?

545