This is not a question what they are, but how they are implemented internally. How does compiler distinguish between checked exceptions (for example derived directly from Exception except RuntimeException) and those unchecked (for example derived from RuntimeException). Are there some special flags in exception class definitions which say what exceptions must be put in try/catch blocks or is there some specific rule in Java compiler (for example Java language design explicitly specifies the type of exceptions which are checked or not)?
2 Answers
All unchecked exceptions are successors from the class RuntimeException or the class Error. All others are checked.
Using reflection, for example, you can always detect which class is a superclass for this specific class of the current exception. This is the same way how Java compiler detects their types.