学习记录26

使用 concat() 方法
public class StringConcatenationUsingConcat {
public static void main(String[] args) {
String str1 = "Hello";
String str2 = " World";
// 使用 concat() 方法拼接字符串
String result = str1.concat(str2);
System.out.println("拼接后的字符串: " + result);
}
}

posted @ 2025-02-20 20:00  吉尼泰梅  阅读(6)  评论(0)    收藏  举报