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.
Thakur Sachin Singh wrote:So where you put return statement if the IF condition is not satisfied and what value you will return?
What is returned is specific to the OP class -- I am not sure if the OP mentioned it in detail in this topic. And how it is done would depend on how complex it is -- and again, specific to the OP class. The Java compiler simply ensures that all code paths through the method returns a value.