Sunday, February 1, 2009

Java Programming - Returning a Value from a Method






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.

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.

Any method declared void doesn't return a value. It does not need to contain a return statement, but it may do so.



Make money from your Website or Blog with BidVertiser
Your Ad Here for FREE!

No comments:

Post a Comment

I'm glad to read your comments: