Java Exception Handling (Try-catch)

  • + 0 comments

    InputMismatchException is an Exception thrown by Scanner class while taking inputs. The statements in which x and y are taking values from object of Scanner class should be within try block to catch that exception.