So for an assignment i need to to replace an Element in an ArrayList. As an example i have a Team Class
class Team {
int id, int points;
String name;
}
I need to find the ID of the Team in the List and replace the Points with new Points. I know i can get the index of the ID with list.get(i).id but i don't know how to replace the Points there. I know that there is a list.set() command but i didn't find how to replace the Points of the Team in the ArrayList because the set Command doesn't accept "i" as a Parameter. Already thanks in advance