<P> the return type is int . The program can therefore rely on the method returning a value of type int . Various mechanisms are used for the case where a subroutine does not return any value, e.g., a return type of void is used in some programming languages: </P> <P> A method returns to the code that invoked it when it completes all the statements in the method, reaches a return statement, or throws an exception, whichever occurs first . </P> <P> You declare a method's return type in its method declaration . Within the body of the method, you use the return statement to return the value . </P> <P> Any method declared void doesn't return a value . It does not need to contain a return statement, but it may do so . In such a case, a return statement can be used to branch out of a control flow block and exit the method and is simply used like this: </P>

Where is a function's return type specified