java - Store primitive values in an EnumMap -


why can't create enummap this:

enummap<funkytrolls, int> amountmap; 

i want count , save number of trolls of each type. way of doing this?

just use integer. generics work on objects, not on primitive types, java has auto-boxing , -unboxing.

this should work:

map<funkytrolls, integer> amountmap = new enummap<funkytrolls, integer>(); amountmap.put(funkytrolls.very_funky_troll, 100); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -