title: Need help catching an exception
body: <p>I am creating a generic <code>Pair</code> class intended for use with integers.</p>
  
  <p>Exception class:</p>
  
  <pre><code>public class WrongThing extends Exception{
      public WrongThing(String message) {
          super(message);
      }
  }
  </code></pre>
  
  <p>Main class:</p>
  
  <pre><code>public class Pair&lt;E&gt; implements Comparable&lt;E&gt;{
      private E var1;
      private E var2;
      public Pair(E var1, E var2) throws WrongThing{
          //this is on purpose!!!
          System.out.println("var1 and var2 are switched");
          this.var1 = var2;
          this.var2 = var1;
      }
  
      void get(){
          System.out.println("the first actualy 2nd: "+
                  var1 + "the ");
                  System.out.println("  second actualy first" + var2);
      }
  
      void set1(E temp){
          System.out.println("var1 and var2 are switched");
          temp = var1;
      }
  
      void set2(E temp){
          System.out.println("var1 and var2 are switched");
          temp = var2;
      }
  
      E smallest(E var1, E var2){
  
          return var1;
      }
  
      @Override
      public int compareTo(Object arg0) {
          // TODO Auto-generated method stub
          return 0;
      }
  }
  </code></pre>
  
  <p>Test case</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.InputMismatchException;
  
  public class PairTest {
      public static void main(String[] args) throws WrongThing{
          System.out.println("two integers please");
          Scanner sc = new Scanner(System.in);
          Pair&lt;Integer&gt; newPair;
          Pair&lt;Integer&gt; tempPair1= new Pair&lt;Integer&gt;(3,2);
  
          try{
              newPair = new Pair&lt;Integer&gt;(sc.nextInt(),sc.nextInt());
              //throw new InputMismatchException("that is not an Integer....");
          }catch(WrongThing exception){
              //System.out.println("you cant do that. try again and press enter after the first integer");
              newPair = new Pair&lt;Integer&gt;(sc.nextInt(),sc.nextInt());
              newPair.get();
  
          }
          finally{
  
  
          }
      }
      //newPair = new Pair&lt;Integer&gt;(sc.nextInt(),sc.nextInt());
  }
  </code></pre>
  
  <p>When I run this code I get an <code>InputMismatchException</code>. Did I not create my exception correctly or not catching it when it is thrown?</p>