Good to everyone, I have two lists that I call from a database of different tables:
listat = personNE.list();
listah = historicot2NE.list();
int inter1 = listat.size(); // 81 datos
int inter2 = listah.size(); // 18 datos
What I want to do the list where it is insured compare with the list that are all the people and print those that are insured and those that are not insured I made those 2 loops but I am wrong
for (int i = 0; i < inter2; i++) {
if (listah.get(i).getCODIGO() == listat.get(i).getCODIGO()) {
pw.println(String.valueOf(listat.get(i).getCODIGO_DOC()
+ "|" + listat.get(i).getCEDULA() + "|" + "0" + "|"
+ "1" + "|" + "|" + 1 + "|"));
}
}
for (int i = 0; i < inter2; i++) {
for (int j = 0; j < inter1; j++) {
if (listah.get(i).getCODIGO() == listat.get(j).getCODIGO()) {
pw.println(String.valueOf(listat.get(i).getCODIGO_DOC()
+ "|" + listat.get(i).getCEDULA() + "|" + "0" + "|"
+ "1" + "|" + "|" + 1 + "|"));
}
}
I hope your help thanks in advance.