title: Exceptions / Try-Catch - Making sure user input is strictly a double & not only an int
body: <p>I'm wondering if there is a way that I can make my code stricter with regard to user input?</p>
  
  <p>I'm trying Exceptions / Try-Catch Blocks, and have to accept some user input and validate that it is the correct date type.</p>
  
  <p>Is there a way that I can make the user input a strict double? i.e. I don't want the user to be able to input a value without a decimal point e.g. an int like 5 &amp; have it be validated and converted to double, returning 5.0 - I want the user to be prompted to enter a double value strictly, making sure that a decimal point is part of the value entered.</p>
  
  <p>Would using Wrappers or something like this be appropriate, and if so - how could I do this?</p>
  
  <p>Current Code:</p>
  
  <pre><code>import java.util.Scanner;
  
  
  public class InputExceptions {
  
      //Do we have to do any Wrapping / instanceOf Double ?
      //Can we accept an integer (no decimal point) for double entry ?
  
      private static int inputInt;
      private static double inputDouble;
  
      public static int inputInt() {
  
          Scanner kybd = new Scanner(System.in);
          boolean inputOK = false;
          while (inputOK == false) {
              System.out.println("*** Please Enter an Integer Value: ");
              try {
                  inputInt = kybd.nextInt();
                  kybd.nextLine();
                  inputOK = true;
              } catch (Exception e) {
                  System.out.println("*** ERROR: VALUE ENTERED NOT INTEGER ***");
                  kybd.next();
              }
          }
          return inputInt;
      }
  
      public static double inputDouble() {
          Scanner kybd = new Scanner(System.in);
          boolean inputOK = false;
          while (inputOK == false) {
              System.out.println("*** Please Enter a Double Value: ");
              try {
                  inputDouble = kybd.nextDouble();
               kybd.nextLine();
                  inputOK = true;
              } catch (Exception e) {
                  System.out.println("*** ERROR: VALUE ENTERED NOT DOUBLE ***");
                  kybd.next();
              }
          }
          return inputDouble;
      }
  
      public static void main(String[] args) {
          System.out.println("*** INTEGER Input: " + inputInt() + " ***");
          System.out.println("*** DOUBLE Input: " + inputDouble() + " ***");
      }
  
  }
  </code></pre>