Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Void is a keyword used in method declarations to indicate that the method does not return any value. It is used when a method performs an action but does not produce a result.
A return statement is used within a method to explicitly return a value back to the caller of the method.
Non-Void Methods: Non-void methods are methods that have a return type other than void. They are used when you want the method to compute and provide some result back.
Main Method: The main method is the entry point of a Java program. It has a specific signature and serves as the starting point for executing code in your program.