On Mon, 1 Aug 2011 23:54:34 -0700 (PDT), Lew <>
wrote, quoted or indirectly quoted someone who said :
>
>In fact, if you only want to handle the IOException-ness of the exception, =
>you wouldn't even bother mentioning 'SQLException' at all. You'd just 'cat=
>ch(IOException...)'. =20
Here is a better example to illustrate my question:
catch (IllegalArgumentException|IOException ex)
What is the compile-time type of ex?
What is the run-time type of ex if you got an
IllegalArgumentException?
What is the run-time type of ex if you got an IOException ?
There may be more grown-up terms for "compile time type" and "run time
type", but I think you know what I mean.
Or is there a rule that catch (a | b ex ) requires a to be a subclass
of b, which would neatly sidestep the problem, but then the feature
would not do anything useful.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Most of computer code is for telling the computer
what do if some very particular thing goes wrong.