public class Filter {
   
   /** Reads double type from keyboard */
   double toDouble(String stringDouble)  {
      double d = Double.parseDouble(stringDouble) ;
      return d ;
   }
      
   /** Method: An entry point for program execution */
   public static void main(String[] args)  {
      String[] values = {"A2.71", "3.14159", "1.6" } ;
      Filter filter = new Filter() ;
      
      // throws NumberFormatException 
      for (int i=0; i < values.length; i++)
         System.out.println("value = " + filter.toDouble( values[i])) ;
   }
}
