Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
THROW:-我们必须处理异常(我们在这里是用户)。
THROW
Throws:我们要求编译器处理引发的异常。
Throws
如果我上面说的有误,请指正。如果错了,请告诉我正确的说法。
感谢进阶!
我会说两者都不准确。
throw语句导致抛出异常。然而,没有人必须抓住它。例如,可以抛出运行时异常,而无需在应用程序代码中捕获它们。
throw
throws是一个关键字,允许声明该方法可能抛出特定类型的异常。
throws