In this example we will show the method to concatenate string in Java.
Source Code
package com.beginner.examples;
public class ConcatenateString {
public static void main(String args[]) {
String str1 = "abc";
String str2 = "def";
System.out.println(str1 + str2); // concatenate string
}
}
Output:
abcdef