Jump to content

Java Programming/Keywords/return

From Wikibooks, open books for an open world

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