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
What are the different approaches to represent an inheritance hierarchy?
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?
Which class is the immediate superclass of the menucomponent class?
What is the purpose of the wait() method?
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
What is the difference between ear, jar and war file?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Are enterprise beans allowed to use thread.sleep()?
how to use debug in my elipse to solve problems that exist in my project
what are getters and setters in Java with examples?
what is a portable component?
How substring() method of string class create memory leaks?
Explain phantom read?
What is a modular application? What does module-relative mean?
How will you pass parameters in RMI? Why do you serialize?