使用 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