2020/08/09 QQ1017871939 小白学习字符串
小白学习字符串
1.字符串,不可变特性
// 字符串演示
public class StringTest1
{
//
public void test3(){
String s1 = "uplooking";
// 字符替换的时候,依然是创建新的字符串
String s2 = s1.replace('u','U');
System.out.println(s1);
System.out.println(s2);
}
public void test2(){
String s1 = "
原创
2020-08-09 13:30:30 ·
217 阅读 ·
0 评论