Concatenate Multiple Strings in Java.

Java 8Object Oriented ProgrammingProgramming

You can concatenate multiple strings using the ‘+’ operator of Java.

Example

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);
   }
}

Output

HelloHowYou
raja
Published on 09-Feb-2018 10:38:48
Advertisements