Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
558 views
in Programming by (95.2k points)
closed by
Additional information sent when an exception is thrown may be placed in ______
1. The throw keyword
2. The function that caused the error
3. The catch block
4. An object of the exception class

1 Answer

0 votes
by (95.4k points)
selected by
 
Best answer
Correct Answer - Option 3 : The catch block

Concept:

An exception is an unexpected event which occurs during run time which disrupts the normal flow of execution. Example: division by zero.

There are two blocks in this: try and catch block.

Explanation:

try block:

It contains set of statements where an exception can occur. It is always followed by a catch block.

catch block:

In this block, exceptions are handled. Additional information sent when an exception is thrown is placed in this block. A single try block can have multiple catch blocks. Throw keyword is used to transfer control from try block to catch block.

syntax:

try

{

// statement that causes exception

}

catch

{

//statements that handle exception

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...