Syntax error String Concatenation by + (string concatenation) operator.

String Concatenation by + (string concatenation) operator.



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

Example

Live Demo

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
Updated on: 2020-02-26T05:57:58+05:30

408 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements