一.String类
1.字符串拼接
1 String str1 = "abcd"; 2 String str2 = "efgh"; 3 System.out.println(str1 + str2); // 用 + abcdefgh 4 5 System.out.println(str1.concat(str2)); // 用 concat() 方法 abcdefgh
一.String类
1.字符串拼接
1 String str1 = "abcd"; 2 String str2 = "efgh"; 3 System.out.println(str1 + str2); // 用 + abcdefgh 4 5 System.out.println(str1.concat(str2)); // 用 concat() 方法 abcdefgh
相关文章: