Code:
import java.io.*;
public class ConcatString{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Input First String:");
String s1 = br.readLine();
System.out.println("input Second String:");
String s2 = br.readLine();
System.out.println("The two string combined in one");
String c = s1.concat(s2);
System.out.println("Combined string: " + c);
Here is the example of the coded being used to concatenate two strings into one , in this code we have used the inbuilt method called as concat method . Similarly we can use some other functions called as String functions.
Bookmarks