Java异常:throws和throw的区别

1、throws使用在函数上;
     throw使用在函数内。

2、throws抛出的是异常类,可以抛出多个,用逗号隔开;
     throw抛出的是异常对象

猜你喜欢

转载自blog.csdn.net/weixin_41113108/article/details/80245137