You are viewing a single comment's thread. Return to all comments →
yeah it worked.. but can you tell me why is it so??
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.