I have a hashMap where key is String and value could be Integer or long . Now in a method I am creating this HashMap and passing into other method something like
methodA(long a,Integer b)
{
Map<String,? super Number> hm = new HashMap<>();
hm.put("key1",a);
hm.put("key2",b);
invokeMethodC(hm);
}
invokeMethodC(Map<String, ?> uriVariables)
{
....
}
Just wanted to know whether i have used correct generics while creating hashMap object