[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: C++

116 / 187

Explain multiple catch statements?

Answer:

It is possible that a program segment has more than one condition to throw an exception. In such case we can associate more than one catch statement with a try. For eg:

Try
{
//try block;
}
catch (type 1 arg)
{
// catch block1;
}
catch (type 2 arg)
{
// catch block 2;
}
……………….
……………….
Catch (type n arg)
{
// catch block n;
}

Asked In ::

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.