title: Convert InputMismatchException into user-defined exception
body: <p>I want my code to change the name of <code>InputMismatchException</code> into <code>NotANumberException</code>.
  This is my code and it's forming an error if I input a non-numeric character. How should I fix this?</p>
  
  <p>Main Class:</p>
  
  <pre><code>import java.util.*;
  
  public class Grade {
  
      public static void main(String args[]){
          Scanner input = new Scanner(System.in);
          int grade;
          String remark;
          try{
              System.out.print("Enter Grade: ");
              grade = input.nextInt();
          }
          catch(NotANumberException e){
              System.out.println(e.notgetMessage());
          }
      }
  }
  </code></pre>
  
  <p>Second class:</p>
  
  <pre><code>import java.util.*;
  
  public class NotANumberException extends InputMismatchException{
  
     public String notgetMessage(){
        return "You did not input a number. Please try again!";
     }
  
  }
  </code></pre>