如何使用 Java 连接两个字符串?
可以使用 concat() 方法连接两个字符串。
示例
public class ConcatinatedStrings {
public static void main(String args[]) {
String str1 = new String("Tutorials");
String str2 = new String( "Point");
String res = str1.concat(str2);
System.out.println(res);
}
}输出
TutorialsPoint
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP