Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

why string is immutable in java

In the String constant pool, a String object is likely to have one or many references. If several references point to the same String without even knowing it, it would be bad if one of the references modified that String value. That's why String objects are immutable
 
PREVIOUS NEXT
Tagged: #string #immutable #java
ADD COMMENT
Topic
Name
8+1 =