Easy Tutorial
❮ Collection Remove Method Tower ❯

Java concat() Method

Java String Class


The concat() method is used to concatenate the specified string argument to the end of the string.

Syntax

public String concat(String s)

Parameters

Return Value

Returns a new string that is the concatenation of the original string and the specified string.

Example

public class Test {
    public static void main(String args[]) {
        String s = "tutorialpro.org:";
        s = s.concat("www.tutorialpro.org");
        System.out.println(s);
    }
}

The output of the above program is:

tutorialpro.org:www.tutorialpro.org

Java String Class

❮ Collection Remove Method Tower ❯