Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NumberFormatException: empty String

807588Aug 12 2009 — edited Aug 12 2009
Can any one help me why this error comes?

the file format is :-

12.00 40.00
13.00 41.00


error:-

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


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();
                    }
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2009
Added on Aug 12 2009
12 comments
915 views