posted 16 years ago
hi,
I have a doubt in Exception Handling.
We can handle exception in two ways:
1)Enclosing code in try..catch block.
2)using throws clause in the caller method.
Example: public void run() throws IOException{
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
int number1=br.readLine(); //This is the method which will throw an
//IOException.So "Run"method handles this
//exception using 'throws' clause(second
//way).
My question is "who is going to handle this exception?", when run() method doesn't wrap the code in try...catch block, it simply throws the exception again.
I need assistance...
thanks