学习记录29
使用 concat() 方法
public class StringConcatenationWithConcat {
public static void main(String[] args) {
String str1 = "Hello";
String str2 = " World";
// 使用 concat() 方法拼接字符串并覆盖 str1
str1 = str1.concat(str2);
System.out.println("拼接并覆盖后的字符串: " + str1);
}
}

浙公网安备 33010602011771号