Here you can find the source of getDouble(String str, double defaultValue)
Parameter | Description |
---|---|
str | a parameter |
defaultValue | a parameter |
public static double getDouble(String str, double defaultValue)
//package com.java2s; public class Main { /**// w w w . ja va2s . c om * @param str * @param defaultValue * @return */ public static double getDouble(String str, double defaultValue) { if (str == null) return defaultValue; try { return Double.parseDouble(str); } catch (Exception e) { return defaultValue; } } }