黑马程序员技术交流社区

标题: 关于字符串 [打印本页]

作者: 小K哥    时间: 2016-4-27 20:27
标题: 关于字符串
String s1 = new String("amit");
System.out.println(s1.replace('m','r'));
System.out.println(s1);
String s3 = "arit";
String s4 = "arit";
String s2 = s1.replace('m','r');
System.out.println(s2 == s3);
System.out.println(s3 == s4);
输出什么呢?为什么呢?




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2