17 lines
390 B
Markdown
17 lines
390 B
Markdown
---
|
||
title: Throw
|
||
localeTitle: 扔
|
||
---
|
||
## 扔
|
||
|
||
Java throw关键字用于显式抛出异常。您可以通过throw关键字在java中抛出checked或uncheked异常。 throw关键字主要用于抛出自定义异常。
|
||
|
||
**_例:_**
|
||
|
||
```java
|
||
throw new ArithmeticException("/ by zero not permitted");
|
||
```
|
||
|
||
##### 更多资源
|
||
|
||
[极客的极客](https://www.geeksforgeeks.org/throw-throws-java/) |