import java.util.Scanner;
public class JavaApplication53 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter Strings:");
String txt1 = scan.nextLine();
String txt2 = scan.nextLine();
String newTxt = "";
if (txt1.length() != txt2.length()){
System.out.println("error");
}
else{
for (int i = 0; i<txt1.length(); i++){
newTxt += txt1.charAt(i)+""+txt2.charAt(i);
}
}
System.out.println(newTxt);
}
}
I hope this helps!