Field (computer science)
In data hierarchy, a field (data field) is a variable in a record. A record, also known as a data structure, allows logically related data to be identified by a single name. Identifying related data as a single group is central to the construction of understandable computer programs. The individual fields in a record may be accessed by name, just like any variable in a computer program. Each field in a record has two components. One component is the field's datatype declaration. The other component is the field's identifier. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
In data hierarchy, a field (data field) is a variable in a record. A record, also known as a data structure, allows logically related data to be identified by a single name. Identifying related data as a single group is central to the construction of understandable computer programs. The individual fields in a record may be accessed by name, just like any variable in a computer program. Each field in a record has two components. One component is the field's datatype declaration. The other component is the field's identifier. type PersonRecord = record lastName : array [ 1 .. 20 ] of Char; firstName : array [ 1 .. 20 ] of Char; age : Integer end; In Pascal, the identifier component precedes a colon, and the datatype component follows the colon. Once a record is defined, variables of the record can be allocated. Once the memory of the record is allocated, a field can be accessed like a variable by using the dot notation. var alice : PersonRecord; alice.firstName := 'Alice'; Over time, the term field has been replaced with the terms data member and attribute. The following Java class has three attributes: firstName, lastName, and age. public class PersonRecord { private String firstName; private String lastName; private int age; } ==See also== ==References==
Cite this
"Field (computer science)". 1782886583. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1361992612 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy