This tutorial will teach you how to concatenate two strings using example.

Java : String Concatenation

This tutorial will teach you how to concatenate two strings using example.

String concat() method : Apart from replacing,
removing splitting the string, Java also provides a method to concatenate the
string, concat(). This method returns the string that represents the
concatenation of the object's characters followed by the string argument's
characters. It appends appends one String to the end of another.

Description : In this example, we have defined two string
variables and pass values to the variables. Now to concatenate both the strings,
we have used concat() method that takes the strings and append one string to the
end of the another. You can concatenate more than two strings also.