I have two arrays of objects:
ArrayList<Object> list1
и ArrayList<Object> list2
.
Example of my code (simplified):
Class Object1 {
String str1 = "example";
}
Class Object2 {
String str2 = "example";
}
ArrayList<Object> list1 = new ArrayList<>();
list1.add(new Object1());
ArrayList<Object> list2 = new ArrayList<>();
list2.add(new Object2());
Problem: I need to compare fields str1 and str2 (between Object1 and Object2 that location in a different arrays)