To declare a variable, specify the following:
- Optional: Modifiers, such as public or final, as well as static.
- Required: The data type of the variable, such as String or Boolean.
- Required: The name of the variable.
- Optional: The value of the variable.
Use the following syntax when defining a
variable:
[public | private | protected | global] [final] [static] data_type variable_name
[= value]
For example:
private static final Integer MY_INT;
private final Integer i = 1;