I need to iterate over the entry set of a map from which I do not know its parameterized types.
When iterating over such entryset, why this does not compile ?
the first code snippet wont compile because the variable map does not exist. You called the parameter anyMap but tried to access it as map, fix that and your code will compile aside from some rawtypes warnings
map
anyMap