Is there a way to search for certain name and display it for arraylist? (like getting a key from hashmap)
The list format is
Name: score -age
{A: 100 - 15, A: 200 - 16, B: 75 -11}
and what I want to do is, getting only A’s data and displaying it.
List<Score> scores = new ArrayList<>();
scores.add(new Score("A", 100, 15));
scores.add(new Score("A", 200, 16));
scores.add(new Score("B", 75, 11));
I think for
ArrayListyou need to traverse your list and find respectivescore elementand show it.