Seo Forum

Coding & Programming => ASP Forum => Topic started by: beingchinmay on 01-18-2017, 00:57:54

Title: Is it possible to execute two catch blocks?
Post by: beingchinmay on 01-18-2017, 00:57:54
You are allowed to include more than one catch block in your program; however, it is not possible to execute them in one go. Whenever, an exception occurs in your program, the correct catch block is executed and the control goes to the finally block.
Title: Re: Is it possible to execute two catch blocks?
Post by: Lishmalinyjames on 03-25-2021, 01:46:16
Yes, you can have multiple catch blocks with the try statement. You start with catching specific exceptions and then in the last block, you may catch base Exception. Only one of the catch block will handle your exception. You can have a try block without a catch block.