Java Programming/Keywords/return

From Wikibooks, open books for an open world
< Java Programming‎ | Keywords
Jump to: navigation, search

return is a Java keyword.

Returns a primitive value, or an object reference, or nothing(void). It does not return object values, only object references.

Syntax:

return variable;  // --- Returns variable
or
return;           // --- Returns nothing