Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 21:09, 20 August 2025 by Dylan (talk | contribs) (new: info, attributes, evaluation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A value is a fundamental concept representing a specific piece of data that can often be manipulated by a program. It is the actual data itself, as opposed to the variable, which is a named container or reference that holds a value. Values are the most basic units of information processed by a program.

Values usually have:

Values can be mutable, meaning their data can be changed after assignment, or immutable, meaning their data cannot be changed after assignment.

In an expression, variables and function calls are evaluated to produce a value before the operation is performed:

int a = 10;    // evaluated to the value 10 then assigned to 'a'
int b = 20;    // evaluated to the value 20 then assigned to 'a'
int c = a + b; // evaluated to the value 30 THEN assigned to 'c'