Results 1 to 2 of 2
  1. #1
    svpriyan is offline Member
    Join Date
    Mar 2009
    Location
    London
    Posts
    8
    Rep Power
    0

    Default NumberFormatException: empty String

    an any one help me why this error comes?

    the file format is :-

    12.00 40.00
    13.00 41.00

    i actual read each line and split and i need each value to comapre with some other values.

    error:-

    java.lang.NumberFormatException: empty String
    at sun.misc.FloatingDecimal.readJavaFormatString(Floa tingDecimal.java:994)
    at java.lang.Double.parseDouble(Double.java:510)
    at Test2Darray.loadData(Test2Darray.java:56)
    at Test2Darray.main(Test2Darray.java:256)

    Java Code:
    String strLine1;
                            int p = 0;
                        strLine1 = br1.readLine();
                        while (strLine1 != null) {
     
                            String[] starwords1 = strLine1.split("[ \\ ]+");
                            for (int q = 0; q < starwords1.length; q++) {
                                year2007[p][q] = Double.parseDouble(starwords1[q]);
                             }
                            p++;
                            strLine1 = br1.readLine();
                        }

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

Similar Threads

  1. NumberFormatException
    By Manfizy in forum New To Java
    Replies: 13
    Last Post: 07-09-2009, 11:59 AM
  2. NumberFormatException raised
    By venkatallu in forum New To Java
    Replies: 1
    Last Post: 06-02-2009, 09:27 PM
  3. XML JDOM XPATH NumberFormatException
    By Jazzperson in forum Advanced Java
    Replies: 3
    Last Post: 03-08-2009, 08:15 PM
  4. NumberFormatException problem
    By bluebarca in forum New To Java
    Replies: 1
    Last Post: 02-06-2009, 07:39 AM
  5. Error: NumberFormatException
    By coco in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •