When you say String is immutable, what do you mean by that?
Say I have String s = "Ness"
s= s+"Technologies";
What will happen? If the value gets appended, then what is
the meaning of immutable here?

Answer Posted / harmetkrishanan

every time a new String object gets created in this case.

Is This Answer Correct ?    24 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is local class in java?

512


If a variable is declared as private, where may the variable be accessed?

542


Can a string be null?

532


Does .length start 0 java?

556


Which java version is latest?

530






Can java object be locked down for exclusive use by a given thread?

572


What do you understand by java virtual machine?

700


Is null a string or object in java?

538


Can you sort a list in java?

519


What are methods?

544


How many bytes is a char in java?

522


Can we override the static method?

564


What is use of super keyword?

561


What are pass by reference and pass by value?

522


What is the functionality of the stub?

563