Ebay Interview Question
Front-end Software Engineersthere are two types of exceptions in java
1> checked exceptions
checked exceptions are also known as compile time exceptions as they are identified during compile time of the program. Exception and all the subclasses of Exception class are checked exceptions
2> Unchecked exceptions
Unchecked Exceptions are also known as runtime exceptions as they are identified during the runtime of the program. class RuntimeException and all the subclasses of RuntimeException are unchecked Exceptions like indexoutofboundexception.
UnChecked Exceptions: Thos exceptions which are bugs in the program and when hit can cause the program to be irrecoverable. These are subclasses of RuntimException. Example are NullPointerException
Checked Exceptions: Exceptions that are not in your immediate control. FileNotFoundException, Input error exceptions etc.
Subclass of Exception
Checked Exceptions and unchecked exceptions
- Tejas June 13, 2011