| Author |
problrm with throw ing a exception but catching into a method declaring thorws
|
thirumala raju
Greenhorn
Joined: Jan 03, 2008
Posts: 9
|
|
hi folks, void met()throws IOException { System.out.println("RRRRW"); throw IOException; } the above piece of code i have declared a method to throws the exception which is occuring in this method IOException.. bbut it is having compile error raja
|
 |
abhishek pendkay
Ranch Hand
Joined: Jan 01, 2007
Posts: 184
|
|
your throw statement is not correct... when you use throw you actually throw a object of IOException (or any other exception you want to throw)... the correct code would be [ January 04, 2008: Message edited by: abhishek pendkay ]
|
The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
|
 |
 |
|
|
subject: problrm with throw ing a exception but catching into a method declaring thorws
|
|
|