The Java String concat() method concatenates one string to the end of another string.This method returns a string with the value of the string passed into the method, appended to the end of the string.
public String concat(String anostr)
anostr- string to be concatenated at the end of the another string.
combination of two strings is returned.
Example:To show working of concat() method
Gfg! is the best.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.