Fiveable
Fiveable

Void Methods

Definition

Void methods are methods in programming that do not return a value. They perform a specific task or action, but they do not produce any output.

Analogy

Think of void methods as actions without a result. It's like asking someone to clean their room without expecting them to give you anything in return.

Related terms

Parameters: Parameters are variables that are passed into a method. They allow us to provide input values for the method to use.

Input Parameters: Input parameters are specific types of parameters that receive input values from the caller of a method.

Return Type: Return type is the data type of the value that a method returns. In void methods, there is no return type because they don't return any value.

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.