Hi,
Can anyone tell me what is the problem with the below code:
String eleSrc=srcEle.toString();
String srcdata_list[]=eleSrc.split("-");
String eleDest=destEle.toString();
String destdata_list[]=eleDest.split("-");
int found=0;
for(int i=0;i<srcdata_list.length;i++)
{
for(int j=0;j<destdata_list.length;i++)
{
if(srcdata_list[i].equals(destdata_list[j]))
{
found++;
System.out.println("matches");
System.out.println("after matches");
break;
}
else
{
System.out.println("in else");
}
}
System.out.println("out of first for lopp");
if(found==0)
{
System.out.println("Not found..appending to list");
missingEle.append(srcdata_list[i]);
}
}
It prints the following O/P:
matches
after matches
out of first for lopp
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
in else
Why is it not going out of the first for loop????