Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




String - concat() Method


String concat(String s)


concat(..) method is used to concatenate two Strings.


Say, we want to join String "Hello" and "World" and make it "HelloWorld".


Example :



public class Test{
	public static void main(String[] arg){
		String firstString = "Hello"; 
		String secondString = "World"; 
		String finalString = firstString.concat(secondString);	   
		
		System.out.println("The combined String is : "+finalString);
	}
}


Output :



  The combined String is : HelloWorld