Painful menstrual periods are periods in which a woman has crampy lower abdominal pain, sharp or aching pain that comes and goes, or possibly back pain. Some pain during your period is normal, but a large amount of pain is not. The medical term for painful menstrual periods is dysmenorrhea.
When an exception occurs, we say that the exception is thrown. For example, we say that Integer.parseInt(str) throws an exception of type NumberFormatException when the value of str is illegal. When an exception is thrown, it is possible to catch the exception and prevent it from crashing the program. This is done with a try..catch statement.
The Integer.parseInt method is a very convenient Java API to transform a user input in String format into a more robust object type which in this case the Integer.Make a note that the parseInt method of Integer class is static thus it should be accessed statically.