27.4.2: Void Data Type
selected template will load here
This action is not available.
The void data type, similar to the Nothing data type described earlier, is the data type for the result of a function that returns normally, but does not provide a result value to its caller. [1]
The void data type has no values and no operations. It’s a data type that represents the lack of a data type.
| Language | Reserved Word |
|---|---|
| C++ |
void
|
| C# |
void
|
| Java |
void
|
| JavaScript |
void
|
| Python | N/A |
| Swift |
Void
|
Many programming languages need a data type to define the lack of return value to indicate that nothing is being returned. The void data type is typically used in the definition and prototyping of functions to indicate that either nothing is being passed in and/or nothing is being returned.