Write code to parse Double from String
//package com.book2s; public class Main { public static void main(String[] argv) { String str = "book2s.com"; System.out.println(getDoubleByStr(str)); }/* w ww . java 2 s.co m*/ public static Double getDoubleByStr(String str) { try { Double temp = Double.parseDouble(str); return temp; } catch (Exception e) { return null; } } }