I want to store distinct values of Strings with an integer associated with them. I have a Pair class that I have to use and a Collection that I have to return.
Is there any possible way to access the integer using a Collection.get(String key) method like a Map class can do?
I want to store distinct values of Strings with an integer associated with them.
Share
I would suggest creating a new class that extends
ArrayList<Pair<String,Integer>>For example: