Create a program that will accept three strings from a user and display the concatenated string.

import java.io.*;
public class ConcatStrings
{
    public static void main(String args[])throws IOException
	{
	   String newStr;
	   InputStreamReader obj=new InputStreamReader(System.in);
	   BufferedReader objectBR=new BufferedReader(obj);
	   System.out.printIn("Enter First String");
	   String str1=objectBR.readLine();
	   System.out.printIn("Enter Second String");
	   String str2=objectBR.readLine();
	   System.out.printIn("Enter third String");
	   String str3=objectBR.readLine();
	   System.out.printIn('\f');
	   newStr=str1+str2+str3;
	   System.out.printIn("The Concatenated string is:"+newStr);
	}
}
Show Buttons
Hide Buttons