title: integer float string differentiation programmatically
body: <p>I want to differentiate between int/float/string input, I am trying to read the input for  </p>
  
  <pre><code>Scanner scan = new Scanner(System.in);
  </code></pre>
  
  <p>this provides input in string format, if i want to check if the input is integer/float or string, how do i do? 
  i did something like this  </p>
  
  <pre><code>try{
   float i = Float.parseFloat(scan.nextLine());
   if(i%1==0){
    then it is integer
   }else{
    it is float
   }
  }catch (NumberFormatException e)
   something else, may be string
  }
  </code></pre>
  
  <p>But is there any method or way java provides to identify programmatically whether the input is string/int/float.</p>