Java tutorial
//package com.java2s; /* * @(#)XMLDataUtil.java 11/25/05 * * Copyright (C) 2002 WebEx Communications Inc. * All rights reserved. * * This software is the confidential and proprietary information of Webex * communications Inc.("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Webex */ public class Main { public static double parseDouble(String value, double defaultValue) { try { return Double.parseDouble(value); } catch (NumberFormatException nfe) { return defaultValue; } } }