You are on page 1of 2

Orlando Miguel Alvarez Alfaro Object Oriented Programming 

Open-Close Questionnaire. Unit 5  Teacher Helue de la Barrera 


 

1. What’s an exception?  

A  minor  error  that  breaks  the  regular  flow  of  a  program  and  must  be 
handled by the programmer. 

2. When does an exception occur? 

During the program execution. 

3. What are the three actions associated with an exception?  

Throwing, propagating and catching an exception 

4. Where are the exceptions defined? 

In  subclasses  that  inherit  the  class  Exception  (and  on  this  parent  class 
too). 

5. Can the programmer define his own exceptions? 

Yes, it is possible.. 

6. What is the reserved word throw used for? 

To  create  a  new  object  of  the  Exception  class  or  its  subclasses  and 
propagate it. 

7. What is the reserved word throws used for? 

To indicate explicitly that a method is an exception propagator. 

8. What is a try block? 

An  enclosed  segment  of  code  were  the  occurrence  of  an  exception  may 
happen. 
9. How many catch blocks can be associated with a try block?  

As many as the programmer defines. 

10.  What  kind  of  instructions  can  the  programmer  use  instead  of 
handling exceptions? 

Validations,  which  look  for  exceptions  and  are  able  to  create  blocks  of 
them,  tagging  each  exception  accordingly  and  not  interrupting  the 
regular flow of the program, validating multiple errors at once. 

You might also like