Java String concat

The java string concat() method combines specified string at the end of this string. It returns combined string. It is like appending another string.


Internal implementation


Signature

The signature of string concat() method is given below:


Parameter

anotherString : another string i.e. to be combined at the end of this string.


Returns

combined string


Java String concat() method example

Test it Now
java string
java string is immutable so assign it explicitly

Java String concat() Method Example 2

Let's see an example where we are concatenating multiple string objects.

Output:

HelloJavatpoint
HelloJavatpointReader

Java String concat() Method Example 3

Let's see an example where we are concatenating spaces and special chars to the string object.

Output:

Hello Javatpoint Reader
Hello!!!
Hello@Javatpoint




Contact US

Email:[email protected]

String concat()
10/30