title: How to check if a String is a valid int or double
body: <p>I am trying to determine if a user's input contains a valid <code>int</code> or <code>double</code> instead of a valid <code>String</code>. If the input is an <code>int</code> or a <code>double</code> the program should state <code>"Invalid make"</code>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>else if (tokens[0].equals("make"))
  {
    if (!tokens[2].equals(String)) System.out.println("     Invalid make");
    // I have 5 spaces above because I don't know how to use printf with strings
    searchByMake(tokens[2]);
  }
  </code></pre>
  
  <p>Edit: Sorry for the confusion guys.. "tokens[]" is an array of strings.</p>
  
  <p>I am trying to get my program to print "Invalid Make" if the user inputs make = <em>number</em> (when <em>number</em> is <code>tokens[2]</code>)</p>