Customized exception handling by try-catch:
• It is highly recommended to handle exceptions.
• In our program the code which may cause an exception is called risky code we have to
place risky code inside try block and the corresponding handling code inside the catch block.
Example:
try
{
risky code
}
catch(Exception e)
{
handling code
}
Comments
Post a Comment