TypeParameter
Encyclopedia
In computer programming languages, TypeParameter is a frequently-used generic label used in templates
Generic programming
In a broad definition, generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters...

 to reference an unknown data type, data structure
Data structure
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...

, or class
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

. Templates are most frequently used in Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 and C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

. TypeParameter is similar to a metasyntactic variable
Metasyntactic variable
In computer science, programmers use metasyntactic variables to describe a placeholder name or an alias term commonly used to denote the subject matter under discussion or an arbitrary member of a class of things under discussion...

 (e.g., "foo" and "bar"), but distinct. It is not the name of a generic variable, but the name of a generic type of variable.

The capitalization varies according to programming language and programmer preference. TypeParameter, Typeparameter, TYPEPARAMETER, typeparameter, and type_parameter are all possible. Alternate labels are also used, especially in complex templates where more than one type parameter is necessary. "X", "Y", "Foo", "Bar", "Item", "Thing" are typical alternate labels. Many programming languages are case-sensitive, making a consistent choice of labels important. The CamelCase
CamelCase
CamelCase , also known as medial capitals, is the practice of writing compound words or phrases in which the elements are joined without spaces, with each element's initial letter capitalized within the compound and the first letter either upper or lower case—as in "LaBelle", "BackColor",...

TypeParameter is one of the most commonly used.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK