FileDocCategorySizeDatePackage
StringToDouble.javaAPI DocExample350Mon Mar 15 19:44:46 GMT 2004None

StringToDouble

public class StringToDouble extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		String aNumber = argv[0];	// not argv[1]
		double result;
		try {
			result = Double.parseDouble(aNumber); 
		} catch(NumberFormatException exc) {
			System.out.println("Invalid number " + aNumber);
			return;
		}
		System.out.println("Number is " + result);