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

390 B

title localeTitle
Throw

Java throw关键字用于显式抛出异常。您可以通过throw关键字在java中抛出checked或uncheked异常。 throw关键字主要用于抛出自定义异常。

例:

throw new ArithmeticException("/ by zero not permitted"); 
更多资源

极客的极客