Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Number Format Exception while parsing long

  1. #1
    Junior Member
    Join Date
    May 2011
    Thanked 0 Times in 0 Posts

    Angry Number Format Exception while parsing long

    Hi All,
    I am getting numberformat exception when converting binarystring to Long
    long test=0;
    Long maxValue=Long.MAX_VALUE;
    String minValueString=Long.toBinaryString(minValue);
    test=Long.parseLong(minValueString,2);// getting exception at this line.

    Any help would be higly appreciated

  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 293 Times in 226 Posts
    Blog Entries

    Default Re: Number Format Exception while parsing long

    Where is the minValue variable?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Replies: 6
    Last Post: March 25th, 2011, 03:42 PM
  2. How to returned random number to original number?
    By i4ba1 in forum Algorithms & Recursion
    Replies: 2
    Last Post: March 19th, 2011, 04:35 AM
  3. How long did it take you to learn?
    By JavaLearner in forum The Cafe
    Replies: 5
    Last Post: March 24th, 2010, 04:42 PM
  4. [SOLVED] Help with code, Says number is NaN and i cant format it
    By NewGuy in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 4th, 2010, 08:28 PM
  5. Exception while parsing jasper document
    By rajumtmm in forum Member Introductions
    Replies: 0
    Last Post: February 26th, 2010, 05:44 AM