📜  如何将字符串加在一起 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.906000             🧑  作者: Mango

代码示例1
//Java
String firstName = "BarackObama";
String lastName = " Care";
//First way
System.out.println(firstName + lastName);
//Second way
String name = firstName + lastName;
System.out.println(name);
//Third way
System.out.println("BarackObama" + " Care");