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 7443431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:44+00:00 2026-05-29T11:19:44+00:00

Integer.parseInt(ff8ca87c, 16); This gives me a NumberFormatException for some reason. Do you know why

  • 0
Integer.parseInt("ff8ca87c", 16);

This gives me a NumberFormatException for some reason. Do you know why that is?

Exception in thread "main" java.lang.NumberFormatException: For input string: "ff8ca87c"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.valueOf(Unknown Source)
  • 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-05-29T11:19:45+00:00Added an answer on May 29, 2026 at 11:19 am

    The reason it fails is that you’re trying to put +0xff8ca87c into a signed integer. The maximum value of a 32-bit signed integer is +0x7fffffff, because the most significant bit is used to store the sign.

    Try using a long instead. The maximum value of a 64-bit signed int is 0x7fffffffffffffff, which is more than adequate for your needs in this case.

    Or, in Java 8 you can use Integer.parseUnsignedInt("ff8ca87c", 16); which will treat the value as an unsigned integer.

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

Sidebar

Related Questions

Why does this part of code fail: Integer.parseInt(11000000000000000000000000000000,2); Exception in thread main java.lang.NumberFormatException: For
Exception in thread Thread-2 java.lang.NumberFormatException: For input string: 3 int test = Integer.parseInt(result[0]); This
I'm getting a NumberFormatException on the Integer.parseInt() method. I know this exception is produced
While writing a game for J2ME we ran into an issue using java.lang.Integer.parseInt() We
So I have the following code: import java.lang.Thread; import java.lang.Integer; class MyThread extends Thread
When I run parseInt: Integer.parseInt(myString); it throws: NumberFormatException: For input string: Does this mean
I've been using java to parse numbers, e.g. (. Integer parseInt numberString) Is there
I come with this: (defn string->integer [str & [base]] (Integer/parseInt str (if (nil? base)
I am setting an alarm for my reminder app: PendingIntent sender = PendingIntent.getBroadcast(AddToDoList.this, Integer.parseInt(DBHelperClass.getMaxPrimaryId()),
When I try to do this: total = Integer.parseInt(dataValues_fluid[i]) + total; It will give

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.