还是相同?
} catch (RuntimeException re) {
...
}
或
} catch (Exception e) {
...
}
RuntimeException
扩展了Exception
,因此Exception
严格更广。(它们是不一样的;例如,IOException
是Exception
而不是RuntimeException
)