HI All,
I trying to build the logic for following requirement ..any help would be appreciated.
I have to compare the elements of array1 and array2.
I have to comapre the each element of array1 with the all elements of array2. If any of the element of array1 doen not exist in array2 then I have to run delete record in db.
Here is my code when run this code I get Index outof bound expection...
I trying to build the logic for following requirement ..any help would be appreciated.
I have to compare the elements of array1 and array2.
I have to comapre the each element of array1 with the all elements of array2. If any of the element of array1 doen not exist in array2 then I have to run delete record in db.
Here is my code when run this code I get Index outof bound expection...
Code:
for (int k = 0; k < array1.length; k++){
System.out.println("First For Loop");
String pID = array1[k].toStrin();
System.out.println("pID>>>>>>>>" + pID);
for (int p = 0; p < array2.length; p++){
System.out.println("Second For Loop");
String cID = array2[p].toStrin();
System.out.println("cID>>>>>>>>" + cID);
if (!pID.equals(cID)) {
//record deleted
System.out.println("Record Deleted");
}
}
}
}