將字符串轉換爲數字:
把一個字符串轉換爲一個int型值,使用integer類中的parseInt方法。
Int intvalue = Integer.parseInt(intString);
intString 是一個數值字符串例如:”123”。
要將一個字符串轉換爲一個double型的值,使用Double類中的parseDouble方法
double doubleValue = Double.parseDouble(doubleString);
doubleString是一個數值字符串,例如”123.45”