I\'m checking to see if a key in my HashMap exists, if it does, I also want to check to see if any other keys have a value with the same name as that of the original key I check
As I understand your question, the values in your Map are List
. That is, your Map is declares as Map
. If so:
for (List listOfStrings : myMap.values()) [
if (listOfStrings .contains(searchcourse) {
// do something
}
}
If the values are just Strings, i.e. the Map is a Map
, then @Matt has the simple answer.