2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Throw
|
|
|
|
---
|
|
|
|
|
|
|
|
## throw
|
2019-04-12 19:04:22 +02:00
|
|
|
The Java throw keyword is used to explicitly throw an exception. You can throw either checked or unchecked exception in java.
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
***Example:***
|
|
|
|
```java
|
|
|
|
throw new ArithmeticException("/ by zero not permitted");
|
|
|
|
```
|
|
|
|
|
|
|
|
##### More resources
|
|
|
|
|
|
|
|
[Geeks for Geeks](https://www.geeksforgeeks.org/throw-throws-java/)
|
|
|
|
|