Constants and constant literals are objects storing temporary values. Constants express basic value types, while constant literals describe values of the complex value types. Constants are referred to through hierarchies or classes.
The number constant has the unit number.
Unsigned positive:
31.27
Signed negative:
-10.4
Scientific:
5.4e+4
The integer constant has the unit integer.
Unsigned positive:
1
Signed negative:
-45
The long constant has the unit long.
Example:
1L
Example:
100000000000001L
The boolean constant has the unit boolean.
A boolean returns either true or false depending on the evaluated condition.
The string constant has the unit string. String constants are expressed in these ways:
With quotes:
"Example of string value"
If you want double quotation marks inside a string, you must double the double quotation mark character within the string, for example:
"Example of string value "" with quote inside"
With square brackets:
$[[Example of string value " with quote inside]]$
With parentheses:
$((Example of string value " with quote inside))$
String constants in square brackets and parentheses can contain any symbols in the string, such as quotes, and they will behave as characters, without being interpreted by the parser for special use.