freeCodeCamp/guide/chinese/java/throw-keyword/index.md

17 lines
390 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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/)