Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7941725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:45:17+00:00 2026-06-03T23:45:17+00:00

Hi I am having an error running this code Map<String, Integer> map = new

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:45:18+00:00Added an answer on June 3, 2026 at 11:45 pm

    Your map contains " " as one of the keys. The code is trying to interpret the " " as a number, yet it’s not a valid number.

    You need to figure out where the space is coming from, and then decide on the best course of action (fix the problem that caused it, ignore it, etc).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having this code when running it on firebug, in the console it will show
i'm having a problem running an sql in ms-access. im using this code: SELECT
I keep having an error when running my web application. The error does not
I am running into an error I am having trouble figuring out. I have
I'm having a real tough time diagnosing a 500 error from my application running
here is the part if having error. Fatal error: Using $this when not in
I`m having the following error . Why am I having this error and how
I am having this error in my j2ee web application. java.sql.SQLException: ORA-00604: error occurred
Having problem with this bit of code qith jQuery. it should pick the values
I have been running into this error for the last 3 or 4 weeks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.