Value Type - Types of Objects With Deep Copy Semantics

Types of Objects With Deep Copy Semantics

Some programming languages—notably C# and D—use the term value type to refer to the types of objects for which assignment has deep copy semantics (as opposed to reference types, which have shallow copy semantics). For example:

int i1 = 42; // "int" is a value type. int i2 = i1; // i2 uses distinct storage for its value: // the value of i1 is "deep-copied" into i2. object o1 = i1; // "Boxing" (see below) from the value type "int" // to a reference type compatible with "object". object o2 = o1; // Since o1 and o2 have reference type, they // now refer to the same value storage; i.e., // o1 is "shallow-copied" into o2.

Other programming languages—e.g., Java—do not formally define the term value type, but their practitioners informally use the term to refer to types with deep copy semantics (such as Java's primitive types).

Read more about this topic:  Value Type

Famous quotes containing the words types of, types, objects, deep and/or copy:

    Our children evaluate themselves based on the opinions we have of them. When we use harsh words, biting comments, and a sarcastic tone of voice, we plant the seeds of self-doubt in their developing minds.... Children who receive a steady diet of these types of messages end up feeling powerless, inadequate, and unimportant. They start to believe that they are bad, and that they can never do enough.
    Stephanie Martson (20th century)

    ... there are two types of happiness and I have chosen that of the murderers. For I am happy. There was a time when I thought I had reached the limit of distress. Beyond that limit, there is a sterile and magnificent happiness.
    Albert Camus (1913–1960)

    There is a very remarkable inclination in human nature to bestow on external objects the same emotions which it observes in itself, and to find every where those ideas which are most present to it.
    David Hume (1711–1776)

    A deep distress hath humanized my Soul.
    William Wordsworth (1770–1850)

    Each reader discovers for himself that, with respect to the simpler features of nature, succeeding poets have done little else than copy his similes.
    Henry David Thoreau (1817–1862)