javaexceptionjvmchecked-exceptionsunchecked-exception

How does JVM handles RuntimeException(s)


While creating custom exceptions, If we want to create a checked Exception we extend the Exception class and for unchecked exception we extend the RuntimeException class. My question is, how JVM handles subClasses of RuntimeException and Exception differently when they all are sub classes of the Exception class.


Solution

  • It doesn't. The only difference is in requirements enforced by the compiler.