Java Programming/Keywords/void

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

void is a Java keyword.

Used at method declaration and definition to specify that the method does not return any type, the method returns void. It is not a type and there is no void references/pointers as in C/C++.

For example:

Computer code
public void method()
 {
   //...
   return;   // -- In this case the return is optional
 }

See also: