用 +(字符串连接)运算符进行字符串连接。


你可以使用 Java 的“+”运算符连接字符串。

示例

现场演示

public class Test {
   public static void main(String args[]){
      String st1 = "Hello";
      String st2 = "How";
      String st3 = "You";
      String res = st1+st2+st3;
      System.out.println(res);
   }
}

输出

HelloHowYou

更新于: 26-2-2020

340 次浏览

开启您的职业

完成课程以获得认证

开始
广告
© . All rights reserved.