Value: contents
of the memory cell associated with the variable.
We usually think of the memory cell as abstract
memory unit/cell.
C++: floating-point value occupies 4
physical bytes, but it is 1 abstract memory
cell.
A variable's value is called r-value.
(r means right)
Content of
variable is on the right of assignment statement.
Type:
The type of a
variable determines
-- the range of values the variable can have
-- set of operations that are defined for
values of the type.
e.g. INTEGER in
FORTRAN: the value range is (-32,768,
32,767)
the operations: +, -, *, /, exponentiation,
absolute value.
the int type in Java specifies a value range of -2147483648 to 2147483647
and arithmetic operations for +, -, *, /, and %(modulus)
Lifetime:
The lifetime of a variable
is the time during which the variable is bound to specific memory location.
The lifetime of a variable
begins when it's bound to a specific cell and ends when it is unbound from
that cell.
Abstract memory cell
- the
physical cell or collection of cells associated with a variable