Hello gunjan khanuja,
Exception Handling needs to be done depends on your code regardless of desktop or web, mobile or any kind of application software.
Mostly programmers *throws* checked exceptions and jvm *throw* unchecked exception, again ofcourse some time programmer throw unchecked exception. ;) . but programmer is not expected to throw any Errors.
So shortly programmer can throw all the mentioned exception except NoClassDefFoundError
John Jai
Bartender
Joined: May 31, 2011
Posts: 1778
posted
0
Technically all the sub classes of Throwable including Error can be thrown using the throw clause. Still as the question asks for 'appropriate', as Seetharaman said Errors are not expected to be handled by the programmer and are thrown for abnormal conditions by the JVM.
A method is not required to declare in its throws clause any subclasses of Error that might be thrown during the execution of the method but not caught, since these errors are abnormal conditions that should never occur.