Java Reference
In-Depth Information
Sally
Black
Tom
Blue
File
Judy
Green
Iris
Orange
Randy
Red
Record
Judy
Green
Field
J u d y
Unicode character J
00000000 01001010
Bit
1
Fig. 1.3 | Data hierarchy.
&, *, (, ), -, +, ", :, ? and /). Digits, letters and special symbols are known as characters .
The computer's character set is the set of all the characters used to write programs and
represent data items. Computers process only 1 s and 0 s, so a computer's character set rep-
resents every character as a pattern of 1 s and 0 s. Java uses Unicode ® characters that are
composed of one, two or four bytes (8, 16 or 32 bits). Unicode contains characters for
many of the world's languages. See Appendix H for more information on Unicode. See
Appendix B for more information on the ASCII (American Standard Code for Informa-
tion Interchange) character set—the popular subset of Unicode that represents uppercase
and lowercase letters, digits and some common special characters.
Fields
Just as characters are composed of bits, fields are composed of characters or bytes. A field
is a group of characters or bytes that conveys meaning. For example, a field consisting of
uppercase and lowercase letters can be used to represent a person's name, and a field con-
sisting of decimal digits could represent a person's age.
Records
Several related fields can be used to compose a record (implemented as a class in Java). In
a payroll system, for example, the record for an employee might consist of the following
fields (possible types for these fields are shown in parentheses):
 
 
Search WWH ::




Custom Search