Ebay Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
Base class of Exception is Throwable(It is not an interface, it is a class)
Checked exceptions are user-defined(as well as standard ones), need to be documented in code and the program can recover from these.
Unchecked throwables are of 2 kinds - RuntimeExceptions and Errors.These aretypically not user-defined. Typically programs will not recover from these and will fail along the way.
You do not throw Errors, JVM throws it if it runs out of resources etc.
You throw RuntimeExceptions (Nullpointer, arrayindexoutofbounds etc) but you do not document these not you handle these in catch blocks.
Errors are reported by JVM for any drastic problems like outofmemory.
- prajna March 07, 2013Base class is Throwable which is extended by IOException(checked) and Runtimeexceptions(Unchecked)