Explain an exceptional handling in java with the help of suitable example.
Java exception handling is managed through five keywords: catch, try, throw, finally and throws. The general form of an exceptional handling block is as follows:
/
try
{
/ /to monitor errors block of code.
}
catch(Exception1 e)
{
/ / exceptional handling 1.
}
catch(Exception2 e)
{
/ /to handle Exception2.
}
finally
{
/ / executed before try block ends.
}