Sobes.tech
Junior — Middle

Which class inherited from Exception is considered an uncontrolled exception?

sobes.tech AI

Answer from AI

In Java, unchecked exceptions are those that inherit from the RuntimeException class. They do not require mandatory handling with try-catch or declaration in throws.

Examples of unchecked exceptions:

  • NullPointerException
  • ArrayIndexOutOfBoundsException
  • IllegalArgumentException

All of these inherit from RuntimeException.

In contrast, checked exceptions inherit directly from Exception, but not from RuntimeException, and require mandatory handling.

Thus, the class RuntimeException and its subclasses are considered unchecked exceptions.

Which class inherited from Exception is considered an… - sobes.tech