Reference type

Reference type

In Object-oriented programming, a reference type is a data type that can only be accessed by references. Unlike objects of value types, objects of reference types cannot be directly embedded into composite objects and are always dynamically allocated. They are usually destroyed automatically after they become unreachable.

Immutable objects are usually of a reference type, where supported.

Language and platform support

* C++ has no built-in support for reference types. However this behavior can be emulated by restricting access to a type's constructor.
* The .NET Framework makes a clear distinction between value and reference types, and allows creation of user-defined types for both kinds.
** In C#, the struct keyword defines a value type, while the class keyword defines a reference type.
** In C++/CLI, the keyword pairs value class and value struct define managed value types, while the ref class and ref struct pairs define managed reference types.
* On the Java platform, all composite and user-defined types are reference types. Only primitive types are value types.
* Windows COM objects are reference-counted reference types.


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Reference (C++) — In the C++ programming language, a reference is a simple reference datatype that is less powerful but safer than the pointer type inherited from C. The name C++ reference may cause confusion, as in computer science a reference is a general… …   Wikipedia

  • Reference Manager — Infobox Software name = Reference Manager caption = author = developer = Research Information Systems; later acquired by Thomson ISI ResearchSoft released = 1984 latest release version = 12 latest release date = 02 09 2008 latest preview version …   Wikipedia

  • Reference ranges for blood tests — Reference ranges edit in: blood urine CSF feces Reference ranges for blood tests are sets of values used by a health professional to interpret a set of …   Wikipedia

  • Type system — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • Reference (informatique) — Référence (informatique) En programmation, une référence est une valeur qui permet l accès en lecture et/ou écriture à une donnée située soit en mémoire principale soit ailleurs. Une référence n est pas la donnée elle même mais seulement une… …   Wikipédia en Français

  • Type biologique — Type (biologie) Pour les articles homonymes, voir Type (homonymie). En sciences de la vie, un type est un élément de référence attaché à un nom scientifique[1] (et non pas à un taxon), à partir duquel une espèce vivante (ou ayant vécu), a été… …   Wikipédia en Français

  • Reference.com — URL reference.com Type of site Encyclopedia, Dictionary, Thesaurus Available language(s) English, Spanish …   Wikipedia

  • Type (biology) — Type specimen for Cimbrophlebia brooksi, a fossil scorpion fly. By convention, the red label denotes a type specimen. In biology, a type is one particular specimen (or in some cases a group of specimens) of an organism to which the scientific… …   Wikipedia

  • TYPE — Modèle qui détermine la forme d’une série d’êtres, lui même étant l’un de ces êtres (prototype, archétype); être qui présente la forme la plus caractéristique ou la plus parfaite d’une série (être «typique», «typé»; «typifier»: exagérer les… …   Encyclopédie Universelle

  • Type 59 — Un Type 59 au Musée militaire de Pékin. Production Production 1958 1980 Unités produites 9500 Caractéri …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”