Why runtime exception is unchecked exception?

Yes. Any Throwable is a checked exception, except for Error, RuntimeException, and (direct or indirect) subclasses thereof.

However, these are checked by the compiler, not by the JVM; checked exceptions are a compile-time feature, not a run-time feature. (Update: And I now see that you've edited your question to specify "compiler" rather than "JVM". ☺)


To elaborate a bit further . . . it's not as though there were any sort of "checked-exception" interface. The logic is simply hard-coded: "any exception class is a checked exception unless it's a subtype of RuntimeException or Error".


Here is a useful link: http://www.javapractices.com/topic/TopicAction.do?Id=129

It explains the difference between unchecked and checked and gives some examples.

"It is somewhat confusing, but note as well that RuntimeException (unchecked) is itself a subclass of Exception (checked)."


It's explicitly in the specification, section 11.1.1:

RuntimeException and all its subclasses are, collectively, the runtime exception classes.

The unchecked exception classes are the runtime exception classes and the error classes.

The checked exception classes are all exception classes other than the unchecked exception classes. That is, the checked exception classes are all subclasses of Throwable other than RuntimeException and its subclasses and Error and its subclasses.

So yes, the compiler definitely knows about RuntimeException.