Files
freeCodeCamp/guide/english/java/throw-keyword/index.md
2019-04-12 22:34:22 +05:30

335 B

title
title
Throw

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");
More resources

Geeks for Geeks