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 are the high-level thread states? : Java thread

562


Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?

609


What is heterogeneous in java?

502


What is your platform?s default character encoding and how to know this?

1757


I want to re-reach and use an object once it has been garbage collected. How it's possible?

559






Why pass by reference is not possible in java?

502


How do you compare characters in java?

525


What is difference between iterator and enumeration in java?

527


What are abstract methods in java?

658


What is ‘has a’’ relationship in java?

730


Is there any difference between synchronized methods and synchronized statements?

586


Can we sort hashmap in java?

535


What are scriptlets?

605


String class is defined under which package in java?

631


What is a boolean field?

531