Java Programming/Keywords/void - Wikibooks, Open Books For An ...

Jump to content
  • Book
  • Discussion
English
  • Read
  • Edit
  • Edit source
  • View history
Tools Tools move to sidebar hide Actions
  • Read
  • Edit
  • Edit source
  • View history
General
  • What links here
  • Related changes
  • Upload file
  • Page information
  • Cite this page
  • Get shortened URL
  • Download QR code
Sister projects
  • Wikipedia
  • Wikiversity
  • Wiktionary
  • Wikiquote
  • Wikisource
  • Wikinews
  • Wikivoyage
  • Commons
  • Wikidata
  • MediaWiki
  • Meta-Wiki
Print/export
  • Create a collection
  • Download as PDF
  • Printable version
In other projects Appearance move to sidebar hide From Wikibooks, open books for an open world < Java Programming | Keywords

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 publicvoidmethod() { //... return;// -- In this case the return is optional //and not necessary to use public but some changes will be there }

See also:

  • Java Programming/Keywords/return
Retrieved from "https://en.wikibooks.org/w/index.php?title=Java_Programming/Keywords/void&oldid=3551876" Category:
  • Book:Java Programming/Keywords
Hidden categories:
  • Pages using deprecated enclose attributes
  • Pages with deep filing
Search Search Java Programming/Keywords/void Add languages Add topic

Tag » What Is Void In Java