I am trying to print out attribute from two different ArrayLists in the same syso. Cant get it to work and killed myself finding out why it doesnt
for (int i = 0; i < resultlist.size(); i++) {
Athlete matched = null;
Result res = resultlist.get(i);
for (int x = 0; x < resultlist.size(); x++) {
Athlete del = athletes.get(i);
if (res.compStartNumber() == del.startNumber()) {
matched = del;
break;
}
}
System.out.println(matched.surName() + " " + matched.lastName() + " has result: " + res.resultValue());
}
Works fine just printing out the resultValue for each Result but cant get it to work with the name aswell. So my question is: What am I doing wrong?