FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Type_declaration

Declaration (computer programming)

In computer programming, a declaration in a syntactic language construct is the process of specifying identifier properties for its initialization: it declares a word's (identifier's) meaning.

  1. For example, Java uses "declaration" (class declaration, method declaration), while Python uses "definition" (class definition, function definition).
  2. This distinction is observed in Pascal "units" (modules), and in conventional C and C++ code organization, which has header files consisting largely of pure declarations, and source files consisting of definitions, though this is not always strictly observed, nor enforced by the language.

References

edit
  1. 1 2 3 4 "A declaration specifies the interpretation and attributes of a set of identifiers. A definition of an identifier is a declaration for that identifier that:
    • for an object [variable or constant], causes storage to be reserved for that object;
    • for a function, includes the function body;
    • for an enumeration constant, is the (only) declaration of the identifier;
    • for a typedef name, is the first (or only) declaration of the identifier."
    C11 specification, 6.7: Declarations, paragraph 5.
  2. Mike Banahan. "2.5. Declaration of variables". GBdirect. Retrieved 2011-06-08. [A] declaration [...] introduces just the name and type of something but allocates no storage[...].
  3. 7. Compound statements, The Python Language Reference

External links

edit

View original on Wikipedia | Back | FazBrowse Home