title: Java double Input Validation
body: <p>below is the code: </p>
  
  <pre><code>    Scanner scan = new Scanner(System.in);
      String input = scan.next();
      try{
          double isNum = Double.parseDouble(input);
          if(isNum == Math.floor(isNum)) {
              System.out.println("Input is Integer");
               //enter a double again
          }else {
              System.out.println("Input is Double");
              //break
          }
      } catch(Exception e) {
          if(input.toCharArray().length == 1) {
              System.out.println("Input is Character");
               //enter a double again
          }else {
              System.out.println("Input is String");
              //enter a double again
          }
      }
  </code></pre>
  
  <p>taken from here: <a href="https://stackoverflow.com/questions/18817826/how-to-check-the-data-type-validity-of-users-input-java-scanner-class">how to check the data type validity of user&#39;s input (Java Scanner class)</a></p>
  
  <p>however, when i input 1.0 or 0.0, it is still considered as an integer, is 1.0 not considered a double?</p>
  
  <p>Please help guys, thank you!</p>