CBSE Class 12 Computer Science Question 14 of 30

Exception Handling — Question 5

Back to all questions
5
Question

Question 5

Forced exceptions are indicated using which of the following keywords?

  1. try
  2. except
  3. finally
  4. raise
Answer

raise

Reason — The raise statement allows the program to force a specified exception to occur at runtime. When a program encounters an abnormal condition during execution, an object of this exception is created and then thrown or raised to the code responsible for catching and handling it.