Saturday, January 26, 2008

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.

1 Comments:

Anonymous Anonymous said...

Nice bentot! galing ah.. wow programmer na xa.

January 18, 2009 at 6:26 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home