可能重複:
Compilation hangs for a class with field double d = 2.2250738585072012e-308程序在解析Double值時掛起?
爲什麼在解析雙精度值0.0222507385850720119e-00306
這個Java程序掛起?
public class DoubleTest {
public static boolean isDoubleValue(String value) {
try {
Double.valueOf(value);
return true;
} catch (NumberFormatException e) {
return false;
}
}
public static void main(String a[]){
DoubleTest.isDoubleValue("0.0222507385850720119e-306");
System.out.println("out of hang...");
}
}
我假設您知道這是一年前由Oracle修復的Java錯誤? – 2012-02-27 04:42:27
您使用的是什麼JDK版本? – Gevorg 2012-02-27 04:46:02
它適用於版本爲1.6.0_26的JVM。 – Alanmars 2012-02-27 04:46:30