通过 `concat()` 方法串联字符串。
可以使用 `String` 类的 `concat()` 方法来串联两个字符串。这个类可以将指定的字符串追加到这个字符串的末尾。
示例
public class Test {
public static void main(String args[]){
String str1 = "Krishna";
String str2 = "Kasyap";
System.out.println(str1.concat(str2));
}
}输出
krishnaKasyap
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP