import java.util.Scanner;
public class JavaApplication68 {
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++){
char c = txt1.charAt(i);
char d = txt2.charAt(i);
newTxt += c+""+d;
}
System.out.println(newTxt);
}
}
}
I hope this helps! BTW, I've completed a bunch of java problems similar to the ones you're posting now. If you want to check them out instead of spending your points, that might be something to look into.