The object thrown by a throw st must be assignable to Exception Error Throwable//t String
Alk
Greenhorn
Joined: Feb 02, 2000
Posts: 25
posted
0
You are Right!! Alk
josephine chen
Ranch Hand
Joined: Oct 29, 2002
Posts: 216
posted
0
but Exception and Error both are correct
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
posted
0
Actually no, it is not correct to say that the object thrown by a throw statement must be assignable to Exception, and it is also not correct to say that the object must be assignable to Error. Each of these statements eliminates the other as a possibility, which is wrong. Only Throwable is correct, because it's the only one that includes all possibilities. [This message has been edited by Jim Yingst (edited February 21, 2000).]
"I'm not back." - Bill Harding, Twister
Tony Alicea
Desperado
Sheriff
Joined: Jan 30, 2000
Posts: 3215
posted
0
Since the question says must, then Throwable is the only correct answer. If it had said may or can then Exception and Error would have also been correct.
Tony Alicea Senior Java Web Application Developer, SCPJ2, SCWCD