Java programming
Data variables
DATA VARIABLES
- Determine the amount of memory required for storage.
- Determine interpretation of the bit pattern in memory.
- Increases portability of software between different hardware.
Data variables require 3 pieces of information:

For example:
- MyHeight as an identifier
- Integer as the data type
- 7 as the data value
Data types are considered to be
reserved keywords and may
not be used as identifiers.
JAVA DATA TYPES
1.
Primitive data types
- byte – signed integer
- short – 2 bytes signed integer
- int – 4 bytes signed integer
- long – 8 bytes signed integer
- float – 4 bytes single-precision IEEE 754 floating point
- float – 8 bytes double-precision IEEE 754 floating point
- boolean – true or false (size is not defined, but likely just 1 bit)
- char – 2 bytes Unicode
2.
Objects
3.
null
Identifiers are user friendly names of variables, functions and constants that must follow these rules:
- Consists of a sequence of letters (A to Z, a to z), digits (0 to 9), dollar sign ($) and underscores (_).
- The first character must be a letter, the dollar sign ($), or the underscore character (_).
- Identifiers are case-sensitive and have no length restriction.
- Identifiers are not reserved keywords.
FROM THE SUN JAVA TUTORIAL