Error in my code?

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
String ans="";
while(t–>0){
String str1=sc.next();
String str2=sc.next();
String fin=str1+str2;
int n=str1.length();
for(int i=0;i<str1.length();i++) {
if(fin.charAt(i)==fin.charAt(i+n)) {
ans=ans+0;
}
else {
ans=ans+1;
}
}
System.out.println(ans);

	}

}

}

@vaibhavvishal98,
https://ide.codingblocks.com/s/240587 corrected code.

Don’t use the same string to append your answer. Reset the string to empty for each test case.