Why doesn't Java allow to throw a checked exception from static initialization block?
问题 Why doesn't Java allow to throw a checked exception from a static initialization block? What was the reason behind this design decision? 回答1: Because it is not possible to handle these checked exceptions in your source. You do not have any control over the initialization process and static{} blocks cannot be called from your source so that you could surround them with try-catch. Because you cannot handle any error indicated by a checked exception, it was decided to disallow throwing of