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.
throw In Java : throw is a keyword in java which is used to throw an exception manually. Using throw keyword, you can throw an exception from any method or block. But, that exception must be of type java.lang.Throwable class or itâs sub classes. Below example shows how to throw an exception using throw keyword. throws In Java :