Here you can find the source of tryParseDouble(Object obj, Double defaultVal)
public static Double tryParseDouble(Object obj, Double defaultVal)
//package com.java2s; //License from project: Apache License public class Main { public static Double tryParseDouble(Object obj, Double defaultVal) { if (obj == null) return defaultVal; if (obj instanceof Double) return (Double) obj; try {//w w w.j ava2 s . c om String val = obj.toString(); return Double.parseDouble(val); } catch (Exception e) { return defaultVal; } } }