fastread homefastrread library fastread menu

Java : String concat

Tutorial by:Arena Buocel      Date: 2016-04-30 01:06:48

❰ Previous Next ❱

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


Signature

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

 
  1. public String concat(String anotherString)  

Parameter

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


Returns

combined string


Java String concat() method example

 
  1. public class ConcatExample{  
  2. public static void main(String args[]){  
  3. String s1="java string";  
  4. s1.concat("is immutable");  
  5. System.out.println(s1);  
  6. s1=s1.concat(" is immutable so assign it explicitly");  
  7. System.out.println(s1);  
  8. }}  
java string
java string is immutable so assign it explicitly

❰ Previous Next ❱


Java

Submit Your Thought, Tutorial, Articls etc.

Submit Your Information India's Number one online promotion website