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

Answers were Sorted based on User's Feedback



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

Answer / manoj

immutable means once created an object that cannot be changed.
if we want to change means it will create another object
that is mutable

Is This Answer Correct ?    7 Yes 0 No

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

Answer / trupti

use string buffers..
String buffers support mutable strings

Is This Answer Correct ?    7 Yes 1 No

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

Answer / 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

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

Answer / ilavarasan

String uses special type of memory in heap is known as
String constant pool.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / java

String s = "PROJECT";
String s2 = s.toLowerCase();

System.out.println(s.equals("PROJECT")); // Prints true
System.out.println(s.equals(s2)); // Prints false
In comparison, consider what would happen if Strings were mutable.

MutableString ms = "PROJECT";
MutableString ms2 = ms.toLowerCase();

System.out.println(ms.equals("PROJECT")); // Prints false
System.out.println(ms.equals(ms2)); // Prints true

Is This Answer Correct ?    0 Yes 0 No

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

Answer / prathap

Because of String pooling String is immutable. Using StringBuffer we can change it as mutable. i.e.,This string literal reference is assaigened to StringBuffer object
Eg : String s="java";
     StringBuffer sb= new StringBuffer(s);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

Is it possible to stop the execution of a method before completion in a sessionbean?

0 Answers  


Is a class a subclass of itself?

0 Answers  


Can I import same package/class twice? Will the jvm load the package twice at runtime?

0 Answers  


Are there books about seam?

0 Answers  


What is meant by Superconductivity?

4 Answers  






Should synchronization primitives be used on bean methods?

0 Answers  


Give me simple example of hibernate caching and explain the details of caching????? thanks in adv.

1 Answers  


Hi frnds ,iam new to java and j2ee ,my requirement is using java or any j2eetech how to lock an user when he enter wrong credentials(uname&password) more than 3 times.take the username and passowrd in a bean no need to conned Db kindly provide me sample application code or and ideas or links or tutorials plzzzzz urgent for me thanks in advance...

2 Answers   NSN,


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

0 Answers   SAP Labs, TCS,


whats is mean by jndi

1 Answers   SolutionNET,


What is J2EE?

2 Answers  


which is the better collection class if the requirement is only displaying the data

1 Answers  


Categories