String s1 =" hello" ; S1 = QUOT;的HelloWorld" sop(s1)如果s1在java中是不可变的,s1值将如何变化 [英] String s1= "hello" ; s1="helloworld" sop(s1) how s1 value will be change if s1 is immutable in java

查看:168
本文介绍了String s1 =" hello" ; S1 = QUOT;的HelloWorld" sop(s1)如果s1在java中是不可变的,s1值将如何变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

String s1 =hello; s1 =helloworldsop(s1)如果s1在java中是不可变的,s1值将如何变化



我想要上面的答案详细解释

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

推荐答案

变量s1不是不可变的;你可以随时将这个变量重新生成一个新的字符串。



字符串hello和helloworld是不可变的;但你在你的问题中反驳了字符串和变量。
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.


这篇关于String s1 =" hello" ; S1 = QUOT;的HelloWorld" sop(s1)如果s1在java中是不可变的,s1值将如何变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆