.For example if i enter two strings ,say input1="sum" and input 2="su". I should get an output saying 'm' is the extra character present in a string.
public class odd {
public static void main(String[] args)
{
boolean b = false;
ArrayList<String> list= new ArrayList<String>();
ArrayList<String> list1= new ArrayList<String>();
String n1="sum";
String n2="su";
for(int i=1;i<n1.length();i++){
for(int j=1;j<n2.length();j++){
if(n1.charAt(i)==n2.charAt(j)){
b=true;
break;
}
else{
System.out.println("Extra character is "+n1.charAt(i));
}
}
}
}
}