title: Java Error "Exception in thread "main" java.util.InputMismatchException" On an Array program
body: <p>I recently typed out this java program to accept ten areas and their pin-codes and then search to find a particular area and print out it's pin-code. 
  Here's the code from the program :</p>
  
  <pre><code>import java.util.Scanner;
  public class Sal {
  
      public static void main (String args []){ 
          Scanner s=new Scanner(System.in);
          System.out.println("Enter 10 areas and their pincodes");
          String area[]=new String [10];
          int pincode[]=new int [10];
          String search;
          int chk=0;
          int p=0;
  
          for (int i=0;i&lt;=9;i++){
              area[i]=s.nextLine();
              pincode[i]=s.nextInt();
          }
  
          System.out.println("Enter Search"); 
          search=s.nextLine();
  
          for (int j=0;j&lt;=9;j++){
              if(search==area[j]){
                  chk=1;
                  j=p;
                  break;
              }
          }
  
          if(chk==1){
              System.out.println("Search Found "+"Pincode : "+pincode[p] );
          } else {
              System.out.println("Search not Found");
          }
      }
  }
  </code></pre>
  
  <p>And after entering two areas I get this ERROR:</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 Sal.main(Sal.java:14)
  </code></pre>
  
  <p>Can someone please tell me what I'm doing wrong! :/ 
  Any help is appreciated.</p>