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 / r.jainrocks@gmail.com

When concatenation operator "+"
used with string

it always creates a new String object,
in String pool area.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does java not support pointers?

543


What is assembly language?

546


Why we use methods in java?

530


Explain the difference between the public, private, final, protected, and default modifiers?

549


What are anonymous inner classes?

559






What are the types of casting?

587


What is the difference between error and an exception?

563


What is difference between stringbuffer and string?

486


How do you use equal in java?

541


What is tcp ip in java?

580


How do you change an int to a string?

543


Why is multiple inheritance not supported in java?

556


Will minecraft java be discontinued?

640


Explain about the interpreter in java?

617


What are desktop procedures?

554