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
Why is string immutable in java?
How can I avoid validating a form before data is entered?
Why do I get a duplicate name error when loading a jar file?
Why do threads block on i/o?
How will you pass parameters in RMI? Why do you serialize?
How substring() method of string class create memory leaks?
what are getters and setters in Java with examples?
Why does the option tag render selected=selected instead of just selected?
What is a modular application?
What restrictions are placed on the location of a package statement within a source code file?
what is an isolation level?
what is a portable component?
Explain phantom read?
Explain how will the struts know which action class to call when you submit a form?
What is a tasks priority and how is it used in scheduling?