Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
String s1= "hello" ; s1="helloworld" sop(s1) how s1 value will be change if s1 is immutable in java

I want above answer with details explanation
Posted
Comments
CHill60 25-Nov-15 7:08am    
Sounds like homework
Patrice T 25-Nov-15 7:23am    
Yet another "DoMyHomework" order, just missed "Answer quickly"
Think about reading Java documentation.

1 solution

The variable s1 is not immutable; you can reaffect this variable to a new string anytime you want.

The strings "hello" and "helloworld" are immutable; but you counfound the string and the variable in your question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900