title: Exception Will not Print Message
body: <p>InputMisMatch Exception</p>
  
  <p>In Java. I have user to input two numbers and if they aren't the same then a Input Mismatch Exception will print out a message. However it's not printing the message. what I'm doing wrong. </p>
  
  <pre><code>package Day4;
  import java.util.InputMismatchException;
  import java.util.Scanner;
  
  public class Calculator {
      int num1 = 0;
      int num2 = 0;
  
  
  
      void add(){
  
          Scanner sc = new Scanner(System.in);
          System.out.println("enter two numbers:");
          int num1 = sc.nextInt();
          int num2 = sc.nextInt();
  
  
  
          try {
              try{
  
                  System.out.println(num1 + num2);
  
              }
              catch(InputMismatchException e)
                  {
                  num1 = sc.nextInt();
                  num2 = sc.nextInt();
                  System.out.println("Invalid Character");
               }
  
  
             }
              catch (ArithmeticException ae)
               {
                  System.out.println("Invalid Number Try again");
  
                 } 
          }
  
  
  
  
  
  
         public static void main(String[] args) {
  
          Calculator c = new Calculator();
          c.add();
          // TODO Auto-generated method stub
  
       }
  
  }
  </code></pre>