title: Exception in thread main java.util.InputMismatchException error
body: <p>I have a question on what's going on, whenever I try to compile it it keeps giving me an error like this:</p>
  
  <pre><code>Exception in thread "main" java.util.InputMismatchException
  at java.util.Scanner.throwFor(Unknown Source)
  at java.util.Scanner.next(Unknown Source)
  at java.util.Scanner.nextInt(Unknown Source)
  at java.util.Scanner.nextInt(Unknown Source)
  at Person.main(Person.java:38)
  </code></pre>
  
  <p>All I want is for the user to be able to input their age and name and have it stored in the "age" and "name" variables, then have it print it out in the bottom string. And if someone would like to help me clean up my code as well, it wouldn't hurt..</p>
  
  <pre><code>import java.util.*; 
  import java.io.*; 
  import java.util.Scanner;
  
  public class Person 
  
  {
  
  public static void main(String[]args) 
  
      {
  
      int age;
      int name;
  
      Scanner scan = new Scanner(System.in);
  
      System.out.println("Enter in your age.");
      age = scan.nextInt();
  
       if (age &lt; 18) 
  
       {
           System.out.println("So you're a kid, huh? That's fine.");
       } 
  
       else if (age &gt;= 18)
  
       {
          System.out.println("Ah, and adult! Good.");
       }
  
       @SuppressWarnings("resource")
       Scanner in = new Scanner(System.in);
  
       System.out.println("Enter in your name");
       name = in.nextInt();
  
       System.out.println("So you're " + age + " years old and your name is " + name);
  
  
  }
  }
  </code></pre>