UNB/ CS/ David Bremner/ teaching/ java/ catch2.java
while(!ok){
  System.out.println("enter a number");
  String s=reader.readLine();
  ok=true;
  try{
    double d=Double.parseDouble(s);
  }
  catch (NumberFormatException e){
    System.out.println("That is not a number!");
    ok=false;
  }
}
//