Concatenate Two Strings in Java



You can concatenate two Strings using the concat() method.

Example

Live Demo

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

Output

TutorialsPoint
Updated on: 2020-02-19T12:50:01+05:30

299 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements