string is immutable? right every one knows that, my
question is it advantage or disadvantage making string
immutable?

Answer Posted / chandu

Sting is Immutable.We can make String as mutable in the give ex
String s="Hello";
String s=s1;
String s2;
s2=s1.append("World");

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between method overriding and overloading?

586


Are private methods final?

488


Can java arraylist hold different types?

500


Mention the default values of all the elements of an array defined as an instance variable.

527


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

857






What is this keyword used for?

695


Can a source file contain more than one class declaration?

518


How does enum work in java?

552


Difference between character constant and string constant in java ?

560


What is java reflection?

541


How do you compare objects in java?

505


What happens if we don’t override run method ?

571


What is the difference between C++ and Java and your preferences?

618


What is a variable simple definition?

581


What is nullpointerexception in java?

529