DO NOT USE! Please use a more specific tag such as [anonymous-function] or [anonymous-class].
The term anonymous has come to represent different aspects of development with the rise of the functional programming style and the use of anonymous on-demand applications.
In an effort to disambiguate this tag, it has been split into the following subcategories:
Category | Description |
---|---|
Anonymous Classes | An anonymous class is a local class without a name. An anonymous class is defined and instantiated in a single succinct expression using the new operator. |
Anonymous Functions | Anonymous functions use a block of code as a value, defining it as an inline function without a name. |
Anonymous Methods | An anonymous method is a procedure or function that does not have a name associated with it. |
Anonymous Types | Anonymous types are data types which dynamically add a set of properties into a single object without having to first explicitly define a type |
Anonymous Users | Anonymous users are individuals or systems that make use of a product or service, without formally registering account details and are instead associated with some token or identifier. |
Former Tag Definition
For new questions, see [anonymous-class] and [anonymous-function].
Typically, a programming language construct like a function or class has a name associated with it -- a symbol that can be used to refer to the construct in some context. An anonymous function or class is one that, in contrast to normal practice, has no name. For example, in Java, you can create an anonymous class using a special syntax that defines a class and constructs an instance of it at the same time:
Runnable r = new Runnable() {
public void run() {
System.out.println("Running");
}
};
The variable r
holds a reference to an instance of a class which has no name in Java, but which implements the Runnable
interface and can be used anywhere a Runnable
instance is needed.