I am getting following error while trying to create generic HashTable.
The method put(String, capture#2-of ?) in the type Hashtable<String,capture#2-of ?> is not applicable for the arguments (String, int)
I need a HashTable, something like following:
HashTable<String, HashTable<String, AnyWrapperType>>
by AnyWrapperType i mean it could be Integer or String or Character or Boolean
I used ?
for AnyWrapperType
, but i got an error.
I also followed link from where i know what i was doing wrong but could find way out.
Hashtable<String, Hashtable<String, String>> paramTocol = new Hashtable<>();
if (standard != null && (!standard.isEmpty())) {
Hashtable<String, String> temp = new Hashtable<>();
temp.put(Appconstants.Col_studentinfo_S_Class,
AvailableClass.getValueByName(standard));
paramTocol.put("standard", temp);
}
if (section != null && (!section.isEmpty())) {
Hashtable<String, String> temp = new Hashtable<>();
temp.put(Appconstants.Col_studentinfo_S_Section, section);
paramTocol.put("section", temp);
}
Here actual value of standard is Integer
in database and value corresponding to section is char
. I am given all these values as String and i need to store them in HashTable, So i want some raw hashtable that will hold all these values. None of the type is User-defined