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.
I tried this out and your are correct! I am guessing here that the Java compiler is smart enough to see that in the doIt() method, the control flow never gets past the throw statement, so it doesn't care about the return value (because it would never be reached anyways). This may be more of an issue with the sourcecode parser then the java language? Anyone got an idea on this one??
<a href="http://www.rajindery.com" target="_blank" rel="nofollow">Rajinder Yadav</a><p>Each problem that I solved became a rule which served afterwards to solve other problems. --Rene Descartes