Computer Science - Object Oriented Programming Using C++ - Discussion
Discussion Forum : Object Oriented Programming Using C++ - Section 1 (Q.No. 2)
2.
A default catch block catches
Discussion:
13 comments Page 1 of 2.
Govind Singh said:
3 weeks ago
Option C is correct: A default catch block catches any thrown object that has not been caught by an earlier catch block.
A default catch block is a catch block that doesn't specify the type of exception it catches. It is usually specified as the last catch block in a try-catch statement, after all other catch blocks that handle specific types of exceptions.
The purpose of a default catch block is to catch any exception that is not caught by the preceding catch blocks.
Therefore, option C is the correct answer.
A default catch block is a catch block that doesn't specify the type of exception it catches. It is usually specified as the last catch block in a try-catch statement, after all other catch blocks that handle specific types of exceptions.
The purpose of a default catch block is to catch any exception that is not caught by the preceding catch blocks.
Therefore, option C is the correct answer.
(1)
Sunny said:
5 years ago
Please Tell me the right answer.
(1)
Akash said:
5 years ago
I think the answer is A.
(1)
Bobby said:
5 years ago
Please provide the correct and clear explanation.
Aakash kr said:
5 years ago
Please give an explanation in detail.
Rahul Vashisth said:
6 years ago
What is the right answer?
Someone please explain me.
Someone please explain me.
Sowjanya said:
8 years ago
I think it is option 'A' that is all thrown objects.
Raksha said:
8 years ago
I think catch thrown object in catch.
Supraja said:
9 years ago
As we know that multiple catches are used with try statement. So if know about the exception then specify it in catch block, otherwise superclass Exception is used to look after all the raised exceptions.
Ashok said:
9 years ago
You're telling is absolutely wrong because according to oop principal catch can catch all the thrown objects thrown by try block whenever user needs understand that particular exception handling we need to specify different kind of exceptions.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers