Field (computer science)

From Wikipedia, the free encyclopedia

In computer science, data that has several parts can be divided into fields. For example, a computer may represent today's date as three distinct fields: the day, the month and the year.

Programming languages usually have a record data type to represent composite data types as a series of fields. An array of boolean values can be represented as a bit field.

Relational databases arrange data as sets of database records, also called rows. Each record consists of several fields; the fields of all records form the columns.

In object-oriented programming, field (also called data member) is the data encapsulated within a class or object. With regular fields (also called instance variables), each instance of the object retains a unique value for each instance variable in the class. With static fields (also called class variables), the class has one variable, which is shared by all instances.

[edit] See also