Table of Contents
Void
TLDR: Void is a keyword used in programming languages like Java, C, and CPP to indicate that a method or function does not return any value. It explicitly defines the absence of a return type, ensuring that the method is intended solely for performing an action or side effect. Void is integral to structuring procedures that modify states, log outputs, or interact with external systems without needing a return value.
https://en.wikipedia.org/wiki/Void_type
In Java, a method declared with the void return type performs its operations without returning any data to the caller. For example, the method `public void printMessage(String message)` outputs a message but does not provide any return value. This contrasts with methods that return specific data types, such as `int` or `String`. Using void simplifies the design of methods that focus purely on procedural logic, such as logging or updating data structures.
https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html
Despite its simplicity, void is not a type in itself but rather a placeholder for “no return.” In some contexts, such as generics in Java, Void (with an uppercase 'V') represents the absence of a return type for flexibility in functional programming scenarios. While void is ubiquitous across programming languages, its consistent use ensures clarity in method purpose and behavior, reducing ambiguity in codebases.
https://docs.oracle.com/javase/specs/jls/se20/html/jls-8.html
- List 30 programming languages support the void Reserved Word. Answer in MediaWiki syntax with the URL of the official documentation for each language reference. Also list the Wikipedia URL if appropriate.
Creating a list of 30 programming languages that specifically support a `void` reserved word or its equivalent concept can be challenging, as not all languages explicitly use `void` or an equivalent keyword. However, many programming languages have a way to denote functions that do not return a value or to specify a lack of type. Below, I've compiled a list of languages that use `void` or a conceptually similar mechanism, along with references to their official documentation and Wikipedia pages where applicable.
- C++
- Official Documentation: s://en.cppreference.com/w/cpp/keyword/void
- Wikipedia URL: s://en.wikipedia.org/wiki/C%2B%2B
- C
- Official Documentation: s://en.cppreference.com/w/c/language/void
- Wikipedia URL: s://en.wikipedia.org/wiki/C_(programming_language)
- Java
- Official Documentation: s://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Java_(programming_language)
- C#
- Official Documentation: s://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/types/void
- Wikipedia URL: s://en.wikipedia.org/wiki/C_Sharp_(programming_language)
- JavaScript
- Official Documentation: s://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void
- Wikipedia URL: s://en.wikipedia.org/wiki/JavaScript
- TypeScript
- Official Documentation: s://www.typescriptlang.org/docs/handbook/basic-types.html#void
- Wikipedia URL: s://en.wikipedia.org/wiki/TypeScript
- PHP
- Official Documentation: s://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.void-functions
- Wikipedia URL: s://en.wikipedia.org/wiki/PHP
- Swift
- Official Documentation: s://docs.swift.org/swift-book/LanguageGuide/Functions.html#ID164
- Wikipedia URL: s://en.wikipedia.org/wiki/Swift_(programming_language)
- Go
- Official Documentation: s://golang.org/doc/effective_go#functions
- Wikipedia URL: s://en.wikipedia.org/wiki/Go_(programming_language)
- Rust
- Official Documentation: s://doc.rust-lang.org/book/ch03-03-how-functions-work.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Rust_(programming_language)
- Kotlin
- Official Documentation: s://kotlinlang.org/docs/reference/functions.html#unit-returning-functions
- Wikipedia URL: s://en.wikipedia.org/wiki/Kotlin_(programming_language)
- Scala
- Official Documentation: s://docs.scala-lang.org/tour/basics.html#void
- Wikipedia URL: s://en.wikipedia.org/wiki/Scala_(programming_language)
- Objective-C
- Wikipedia URL: s://en.wikipedia.org/wiki/Objective-C
- Dart
- Official Documentation: s://dart.dev/guides/language/language-tour#functions
- Wikipedia URL: s://en.wikipedia.org/wiki/Dart_(programming_language)
- Ruby
- Equivalent Concept: Methods return the value of the last expression evaluated.
- Official Documentation: s://ruby-doc.org/core-2.7.0/doc/syntax/methods_rdoc.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Ruby_(programming_language)
- Python
- Equivalent Concept: Functions return `None` by default.
- Official Documentation: s://docs.python.org/3/tutorial/controlflow.html#defining-functions
- Wikipedia URL: s://en.wikipedia.org/wiki/Python_(programming_language)
- Perl
- Equivalent Concept: Subroutines return the last expression evaluated.
- Official Documentation: s://perldoc.perl.org/perlsub
- Wikipedia URL: s://en.wikipedia.org/wiki/Perl
- Lua
- Equivalent Concept: Functions without a return statement return `nil`.
- Official Documentation: s://www.lua.org/manual/5.4/manual.html#3.3.4
- Wikipedia URL: s://en.wikipedia.org/wiki/Lua_(programming_language)
- Haskell
- Equivalent Concept: Uses `()` for functions that do not return a meaningful value.
- Official Documentation: s://www.haskell.org/tutorial/functions.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Haskell_(programming_language)
- Erlang
- Equivalent Concept: Functions can return `ok` or other values to indicate no meaningful value.
- Official Documentation: ://erlang.org/doc/reference_manual/functions.html
- Wikipedia URL: [
https://en.wikipedia.org/wiki/Erlang_(programming_language)]
- Clojure
- Equivalent Concept: Functions return `nil` when there is no explicit return value.
- Official Documentation: s://clojure.org/guides/learn/functions
- Wikipedia URL: s://en.wikipedia.org/wiki/Clojure
- F#
- Equivalent Concept: Uses `unit` type for functions that do not return a value.
- Official Documentation: s://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/unit-type
- Wikipedia URL: s://en.wikipedia.org/wiki/F_Sharp_(programming_language)
- Visual Basic .NET
- Official Documentation: s://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/
- Wikipedia URL: s://en.wikipedia.org/wiki/Visual_Basic_.NET
- Pascal
- Equivalent Concept: Procedures are used for code that does not return a value.
- Official Documentation: s://www.freepascal.org/docs-html/ref/refsu58.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Pascal_(programming_language)
- Ada
- Equivalent Concept: Procedures do not return a value.
- Official Documentation: ://www.adaic.org/resources/add_content/standards/12rm/html/RM-6-1.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Ada_(programming_language)
- Fortran
- Equivalent Concept: Subroutines do not return a value.
- Official Documentation: s://gcc.gnu.org/onlinedocs/gfortran/Subroutines.html
- Wikipedia URL: s://en.wikipedia.org/wiki/Fortran
- MATLAB
- Equivalent Concept: Functions without a return value.
- Official Documentation: s://www.mathworks.com/help/matlab/ref/function.html
- Wikipedia URL: s://en.wikipedia.org/wiki/MATLAB
```
This list showcases the diversity of approaches to functions that do not return values across different programming languages, ranging from the explicit use of `void` or similar keywords to implicit conventions like returning `None`, `nil`, or using specific constructs like procedures or subroutines.
Disambiguation
Disambiguation in a Wiki is the process of resolving conflicts that arise when a potential article title is ambiguous, most often because it refers to more than one subject covered by this Wiki, either as the main topic of an article, or as a subtopic covered by an article in addition to the article's main topic.
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.