title: Validation input to be string only and numbers only JAVA
body: <p>I am a student and i have a little problem with validation inputs.</p>
  
  <pre><code>String name;
  System.out.println("Enter name:");
  name = keyboard.nextLine();
  //If name contain other than alphabetical character print an error
  
  double number;
  System.out.println("Enter number:");
  name = keyboard.nextDouble();
  //If number contain other than number print an error
  </code></pre>
  
  <p>What i have tried is test to parse the string to double but i could not.
  I have no idea how to test if the double is only number.</p>
  
  <p>Please give me a clue of what i should do.</p>