WEB DEVELOPER SITE
PHP7
 

Java String concat() Method



This method Concatenates the specified string to the end of this string.


Syntax

Here is the syntax of this method โˆ’

public String concat(String s)

Parameters

Here is the detail of parameters โˆ’

  • s โˆ’ the String that is concatenated to the end of this String.

Return Value

  • This methods returns a string that represents the concatenation of this object's characters followed by the string argument's characters.

Example


public class Myproject {

   public static void main(String args[]) {
      String s = "Strings are immutable";
      s = s.concat(" all the time");
      System.out.println(s);
   }
}

Run example ยป