String is immutable.it is true
String can be change to mutable How?

Answer Posted / sharief

Yes,String is immutable.The simple meaning of immutable is
unmodifiable or unchangeable.once String object has been
created,its value can not be changed.
The Reason is java uses concept of String literal.Suppose
there are 5 reference variables,all referring to an object
called "Ronaldo".If one reference variable changes the value
of the object,it will be affected to all the reference
variables.That is why String objects are immutable in java.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different approaches to represent an inheritance hierarchy?

822


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

1822


Which class is the immediate superclass of the menucomponent class?

909


What is the purpose of the wait() method?

824


What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?

781


What is the difference between ear, jar and war file?

807


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

779


Are enterprise beans allowed to use thread.sleep()?

885


how to use debug in my elipse to solve problems that exist in my project

1985


what are getters and setters in Java with examples?

1497


what is a portable component?

1674


How substring() method of string class create memory leaks?

776


Explain phantom read?

1976


What is a modular application? What does module-relative mean?

755


How will you pass parameters in RMI? Why do you serialize?

927