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.
我经常听到一些建议,捕捉Throwable或Error是不好的做法,Java 开发人员应该避免捕捉这些,我不知道为什么?
如果语言允许您捕获任何java.lang.Throwable实例,那么捕获它们或它们的子类 java.lang.Error 的问题是什么?
如果它们不好,Java本身不应该禁止它们捕获吗?
请给我建议答案。提前致谢。