Next: Constants
Up: Variables, constants, and keywords
Previous: Primitive data types
Contents
Subsections
- A literal is a vlue that can be assigned to a primitive or string variable, or passed as an argument to a method call.
- true
- false
- boolean isTrue = true;
- '
\n' - newline
- '
\r' - return
- '
\t' - tab
- Expresses a floating-point numerical value.
- 3.1438 - a decimal point
- 4.33E+11 - E or e; scientific notation
- 1.282F - F or f; 32-bit float
- 1355D - D or d; 64-bit double
- A sequence of text enclosed in double quotes.
- String fourScore = "Four score and seven years ago";
Next: Constants
Up: Variables, constants, and keywords
Previous: Primitive data types
Contents