Payal, If you examine the code, there are 2 possibilities that can occur
Exception occurs and the control goes to catch block
There is no exception and try and finally gets executed
In the first case,after executing the println() statement of the catch block, the final block gets executed and then the control comes back to return statement of the catch block.So the statement outside the try..catch..finally doesnot get a chance to execute. In the second case, after printing "try" in the try block, the control goes to final block.Here the value of d is initialized and after that the control goes back to the try block which executes the return statement.Again, the return statement outside the try..catch..finally doesn't get a chance to execute. The compiler recognizes this fact and hence throws an error that the statement is not reached. I have discussed in some other post that you can have one return statememt for every block (i.e. try,catch and finally).However, you need to be careful while having it outside.It will compile only if the compiler sees that there is a possible exit by executing that return statement. Hope this helps, Sandeep SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform) [This message has been edited by Desai Sandeep (edited July 26, 2001).]
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads: