Throw in Java


throw

The Java throw keyword is used to explicitly throw an exception. You can throw either checked or unchecked exception in java.

Example

throw new ArithmeticException("/ by zero not permitted");

This article needs improvement. You can help improve this article. You can also write similar articles and help the community.