I used Collections.sort(playersList); to sort a List. So, I think playersList is sorted now. But how can I get the first element of the list? playersList[0] does not work.
Collections.sort(playersList);
List
playersList
playersList[0]
playersList.get(0)
Java has limited operator polymorphism. So you use the get() method on List objects, not the array index operator ([])
get()
[]
1.4m articles
1.4m replys
5 comments
57.0k users