Here you can find the source of toDouble(String doubleString, Double defaultValue)
protected static Double toDouble(String doubleString, Double defaultValue) throws NumberFormatException
//package com.java2s; //License from project: Open Source License public class Main { protected static Double toDouble(String doubleString, Double defaultValue) throws NumberFormatException { try {/*from w w w . j a v a 2 s. c o m*/ double d = Double.parseDouble(doubleString); return d; } catch (NumberFormatException e) { return defaultValue; } } }