Here you can find the source of toDouble(String input, double defaultValue)
public static double toDouble(String input, double defaultValue)
//package com.java2s; //License from project: Apache License public class Main { public static double toDouble(String input, double defaultValue) { try {/*from w w w.java 2 s .c o m*/ return Double.parseDouble(input); } catch (Exception e) { return defaultValue; } } }