I have an ArrayList of objects. Each object is of type Player (one of the classes that I have). Each Player object has a getName() method and a getValue() method. The getValue method is of integer type. All the Player objects go into an ArrayList, listOfPlayers. How do I find a PLayer object with the highest getValue()?
I know there is a method called Collections.max(), but for me it only seems to work if the ArrayList is just full of integers.
Thanks