This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Here in the above code : the statement "return 1;" is unreachable as it comes after the explicit throw exception statement. Thus the statements written after the throw in the try block are all unreachable codes, as they will never be executed. In this code statements , the finally block doesn't work normally as even after the return from catch block, the finally block has to run and return value. Thus we get o/p 3.