“线程中的异常”;“主要”;java.lang.NumberFormatException:对于输入字符串:";2012年8月3日“;

“线程中的异常”;“主要”;java.lang.NumberFormatException:对于输入字符串:";2012年8月3日“;,java,numberformatexception,Java,Numberformatexception,为什么我会收到这些错误消息 Exception in thread "main" java.lang.NumberFormatException: For input string: "8/3/2012" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222) at java.lang.Double.parseDouble(Double.java:510) at com.exe

为什么我会收到这些错误消息

Exception in thread "main" java.lang.NumberFormatException: For input string: "8/3/2012"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222)
    at java.lang.Double.parseDouble(Double.java:510)
    at com.exel.raf.seeit.ExecuteImport.excelDtToString(ExecuteImport.java:713)
    at com.exel.raf.seeit.ExecuteImport.generateItemHistorySql(ExecuteImport.java:649)
    at com.exel.raf.seeit.ExecuteImport.execute(ExecuteImport.java:56)
    at com.exel.raf.seeit.ExecuteImport.main(ExecuteImport.java:38)
    Process exited with exit code 1.

日期8/3/2012不是正确的数字类型。检查要将其解析为Double的代码行

从java文档中

抛出以指示应用程序已尝试将字符串转换为其中一种数字类型,但该字符串没有适当的格式


如果您试图将字符串转换为数字。在上述情况下,我认为您的字符串是“8/3/2012”。要转换为任何数字,除数字外不能有任何字符,或者如果需要小数,可以使用double


这看起来像一个日期,请浏览date类并查看如何将其转换为日期。

发布导致它的代码。8/3/2012是字符串值,您将其解析为数字,Double.parseDouble请查看代码的510行什么使您认为“8/3/2012”是一个有效数字。您的代码中有一些问题。请共享导致此错误的代码片段。