concat() Method In Java Example
Chapter:
String Handling
Last Updated:
10-06-2016 16:58:51 UTC
Program:
/* ............... START ............... */
public class JavaConcatExample {
public static void main(String args[]) {
String s = "Welcome to ";
s = s.concat("JavaScan.com");
System.out.println(s);
}
}
/* ............... END ............... */
Output
Notes:
-
The java.lang.String.concat() method concatenates the specified string to the end of this string.
- You can append two strings by just using '+' sign also.
Tags
concat(), Java