Hi guys i got 2 ArrayList based on same class. I have to add from arraylist1 to arraylist2 non exist(s)ing rows. I tried to use contains but its always returning false. What i m doing wrong ? Ty
MyClass
public class HataKoduBean {
private String Oid;
private String Name;
private String Surname;
}
How i define Arraylists
Arraylist<MyClass> array1 = new Arraylist<>();
Arraylist<MyClass> array2 = new Arraylist<>();
How i tried to compare ?
for (int ii = 0; ii < array1.size(); ii++) {
if (!array2.contains(array1.get(ii)))
array2.add(array1.get(ii));
}