E
Enkidu
I'm just beginning to try to understand Exceptions, so this is probably
a naive question.
Suppose I have a class (A) that has a 'while' loop in a method. Within
this loop the method calls a method of another class B. The method call
is within a 'try'. When the Exception occurs in class B the 'catch'
clause in class A is invoked and handled.
In the 'while' loop, if an Exception has occurred, I'd like the loop to
'continue' rather than merely continue on. Is it legitimate to have the
'continue' in the 'catch'?
Or should I set some indicator in the 'catch' and then use an 'if' to
check the indicator and 'continue'?
Or should I restructure the code (which isn't written yet) completely?
Cheers,
Cliff
a naive question.
Suppose I have a class (A) that has a 'while' loop in a method. Within
this loop the method calls a method of another class B. The method call
is within a 'try'. When the Exception occurs in class B the 'catch'
clause in class A is invoked and handled.
In the 'while' loop, if an Exception has occurred, I'd like the loop to
'continue' rather than merely continue on. Is it legitimate to have the
'continue' in the 'catch'?
Or should I set some indicator in the 'catch' and then use an 'if' to
check the indicator and 'continue'?
Or should I restructure the code (which isn't written yet) completely?
Cheers,
Cliff