Yes. Because s =s.toUpperCase(),这个语句把s又指向了变为大写的字符串。如果你写成:
String s = "Hello";
String s1 = s.toUpperCase();
System.out.println(s); //Hello 没变
System.out.println(s1); //HELLO 变为大写
- 1
Yes. Because s =s.toUpperCase(),这个语句把s又指向了变为大写的字符串。如果你写成:
String s = "Hello";
String s1 = s.toUpperCase();
System.out.println(s); //Hello 没变
System.out.println(s1); //HELLO 变为大写
用户6617885566
why my result is changed?
Hello
HELLO
is it correct?