Hi I am having an error running this code
Map<String, Integer> map = new TreeMap<String, Integer>();//Already populated public ArrayList<Map<String, Integer>> storage(){ for (String getCharacter : map.keySet()){ String convertBinGrp; **Integer binGroups = Integer.valueOf(getCharacter);** if ( binGroups>=0 && binGroups<= 32){ convertBinGrp = Long.toString(binGroups); binInsideList.get(convertBinGrp); Integer getVal = getCharacter.getValue(); binInsideList.put(convertBinGrp, getVal); } } error message: Exception in thread "main" java.lang.NumberFormatException: For input string: " "
The error indicated is the Integer binGroups = Integer . valueof(getCharacter) casting. I've already tried using long and double just to make sure its size is bigger because I understand its a String value taken from Map. But is there any other way to solve this? I wanted to convert the String into a numerical value so that I can put it into proper bins or groups. Thanks