I have two arrays of objects in Java, which contain some fields that I need to compare, but the thing is I need to compare element by element, that means, that I want the compare a field from the first object in my first array with the first object in my second array, my second object from the first array with my second object from the second array and so on. This is what I have done so far, but the idea is that I do not know what should be the limit for my second array. From my point of view the second array should start from the index of the first array like this:
for(int i = 0; i < resultEntries.size(); i++) {
for(int j = i; j < resultColorEntries.size(); j++) {
if(resultEntries.get(i).getColor())...
};
}
Another solution or a solution to my problem would be welcome. Thanks in advance!