concat two strings java

concat() String Example

java.lang.String class comes with concat() String method to concatenate two strings. The signature is given as defined in String class. public String concat(String str): Returns a new string, the result of concatenation of two strings. Following example concat() String illustrates the usage concat() method.

Output screenshot on concat() String…