title: Is there a String equivalent in java to input.hasNextInt?
body: <p>I'm used to checking if a user inputs a double or a integer with <code>input.hasNextDouble</code>/<code>input.hasNextIn</code>t and then assigning a variable if this is true with <code>input.nextDouble</code>()/<code>input.nextInt()</code>. </p>
  
  <p>But now I want to check if the input is a String or not, and if so, assign my variable, and if not, produce an error message and loop again. Is there an equivalent method/statement like this for Strings in Java? Or another way to do so? </p>