您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Extend Index

Extend Page # 7

Reflective Question 3

If a method passes an exception upwards (that is, declares it as being thrown out of the method), then the method that called the throwing method must itself catch the exception. If this method in its turn throws the exception upwards, and all other methods do the same, eventually we will reach the ‘top’ of the calling chain, and there will be nowhere to ‘throw’ the exception. What will happen to the program then? Should the compiler allow the programmer to define such a sequence of throws and, if so, what happens when the exception reaches the ‘top’?

Discussion of Reflective Question 3

 basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg