近日阅读 Java Language Specification 11,发现文档中提到
- Most user-defined exceptions should be checked exceptions.
但是 Stackoverflow 上的这个提问 Understanding checked vs unchecked exceptions in Java 又让我认识到另外两点
- Use checked exceptions for recoverable conditions and runtime exceptions for programming errors (From Effective Java Item 58 in 2nd edition)
- 很多高赞回答让我感觉自己基本不应该定义 Checked Exception 的子类
问题:
- JSL 在这个问题上的坚持算是孤注一掷还是曲高和寡呢?