Fields may be stored in
random access memory (RAM). The following
Pascal record definition has three field identifiers: firstName, lastName, and age. The two name fields have a datatype of an
array of
character. The age field has a datatype of
integer. 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'; 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; } == File fields ==