I have an ArrayList which stores Area names. I want to check this list to find whether arbitrary people are from different area. If they are from different area, i take a decision. I achieved this with the following code. Note that area_IdList and area_IdListduplicate are essentially the same ArrayList. Is this code efficient or can anyone suggest more efficient code ? Thanks in Advance.
public List<String> area_IdList = new ArrayList<String>();
public List<String> area_IdListduplicate = new ArrayList<String>();
for (int i = 0; i < area_IdList.size(); i++)
{
for (int k = 1; k< area_IdListduplicate.size(); k++)
{
String sa= area_IdListduplicate.get(k);
String sb= area_IdList.get(i);
if (!sa.equalsIgnoreCase(sb))
{
some decision
}
}
}