Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
double displayNumber = Double.valueOf(display.getText()).doubleValue()
请在此声明中向我解释 .valueOf 和 .doubleValue 的用途和需要。
Double.valueOf返回一个Double类型,然后调用doubleValue()为您提供原始双精度类型。您可以将这两种方法替换为Double.parseDouble
Double.valueOf
Double
doubleValue()
Double.parseDouble
到
double displayNumber = Double.parseDouble(display.getText())