Concept
What is a void method in Java?
ComputerScienceOne / Void Methods
"The keyword void can be used in Java to indicate a method does not return a value, in which case it is called a “void method.” Though it is not necessary, it is still good practice to include a return statement.\n\npublic static void printCopyright()\n\nSystem.out.println(\"(c) Bourke 2015\");\n\nreturn;\n\n}\n\nIn the example above, we’ve also illustrated how to define a method that has no input parameters."
Related Ideas
- How are void functions defined in C?ComputerScienceOne · Void Functions
- Why is the Utils.methodName() syntax used for methods?ComputerScienceOne · Passing By Reference
- How do member methods differ from static methods?ComputerScienceOne · Accessor & Mutator Methods
- How do C functions return values to the calling function?ComputerScienceOne · Void Functions
- How do you use methods defined in another Java class?ComputerScienceOne · Using Methods
- How do you write a basic Hello World program in Java?ComputerScienceOne · Getting Started: Hello World
- What role does the main() method play in a Java program?ComputerScienceOne · The javamain() Method
- How are Java class instances created and used?ComputerScienceOne · Common Methods