class TestLowerCase
{
public static void main(String[] args)
{
String a = "ABCD";
String b = a.toLowerCase();
System.out.println(b);
b.replace('a','d');
我改好了,需要对b重新赋值,
class TestLowerCase
{
public static void main(String[] args)
{
String a = "ABCD";
String b = a.toLowerCase();
System.out.println("修改前b:"+b);
b = b.replace('a','d');//将替换后的值在赋给b
b = b.replace('b','c');//将替换后的值在赋给b
System.out.println("修改后b:"+b);
}
}