Java String concat() Method
The String concat() method is used to concatenates str2 at the end of string str1.
Syntax:
public String concat(String anotherString)
Example:
public class Concatmethod{
public static void main(String args[]){
String s1="Welcome";
String s2=s1.concat(" to Onlinetpoint"); // string concate method
String s3=s1+" to Onlinetpoint";// concate using + operator
System.out.println(s2);
System.out.println(s3);
}
}
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.
point.com