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 ?
<
You're getting the compile time rrror because you are not specifying the type in HashMap
Like
HashMap <(Integer,String> hm=new HashMap<(Integer,String>();
If you specify the type as Integer and String, you don't get the compile time error.
IF you Dont Know which Value is going to Add in your HashMap then You Use
HashMap<(Object,Object> hm=new HashMap();