[英]java - Exception in thread “main” java.lang.NumberFormatException: For input string: “” at
[英]Exception in thread "main" java.lang.NumberFormatException: For input string: "8/3/2012"
為什么我收到這些錯誤消息。
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。
這看起來像一個日期,請瀏覽 Date 類,看看如何將其轉換為日期。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.