|
Java variables are assigned a data type in one of four basic categories: - Arithmetic (fixed or floating point numbers)
a) byte (1 byte) b) short (2 bytes) c) int (4 bytes) d) long (8 bytes)
- Character (actually two byte Unicode characters)
- Boolean (true or false)
- Access (a cross between a pointer and a handle)
Character:
Java character variables and strings support the international two byte character set commonly known as Unicode. This allows strings to hold not only has all the characters in Western and Eastern Europe, but also Hebrew, Arabic, Cyrillic, and 30,000 characters belonging to Chinese/Japanese/Korean. The first 128 codes of the Unicode standard are the ordinary ASCII characters. ASCII characters are converted to Unicode by simply adding a high order byte of zero, and the Unicode representation of ordinary ASCII characters can be converted to plain ASCII by just dropping the high order byte. Boolean:
A variable of type boolean has the possible values true or false. Unlike other languages, boolean values are not associated with 0 or 1, may not be converted directly to any number, and have no ordering. |