Primitive type

In computer science, primitive types - the opposite of composite types - are datatypes with which valuess have a one-to-one correspondence to data objects stored in computer memory. They may be thought of as datatypes that are unable to be constructed from other datatypes.

Primitive types are also known as built-in types or basic types.

The actual range of primitive types that is available is dependent upon the specific programming language that is being used. For example, in C, stringss are not implemented as a primitive datatype, whereas in other languages they may be.

Typical primitive types include:

Operations on primitive types are fastest; integer addition, for example, is nothing but addition at the machine level.

Most programming languages, even object-oriented programming languages, do not allow extending primitive types, partly because such extension makes little sense but mainly because it is hard to implement such function without sacrificing the simplicity and efficiency. Composite types may be created using primitive types and/or other composite types.

This article is a stub. You can help Wikipedia by [ expanding it].





Google
Home   Alphabetical Listing   Quote


This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.