Concatenate two strings in Java

package javabasics;

public class ConcatenatesTwoStrings 

	public static void main(String[] args) 
		String S1 = "India is my country";
		String S2 = "USA is my country";
		//Concatenates S2 with S1.
		System.out.println("Concatenation of S1 and S2 Is : --- "+S1.concat(S2)+"\n");	  



Concatenation of S1 and S2 Is : --- India is my country  USA is my country


Leave a Reply

Your email address will not be published. Required fields are marked *