A value directly written into the source code of a computer program (as opposed to an identifier like a variable or constant). Literals cannot be changed. Common types of literals include string literals, floating point literals, integer literals, and hexidemal literals. Literal strings are usually either quoted (") or use an apostrophe (') which is often referred to as a single quote. Sometimes quotes are inaccurately referred to as double quotes.
A value directly written into the source code of a computer program (as opposed to an identifier like a variable or constant). Literals cannot be changed. Common types of literals include string literals, floating point literals, integer literals, and hexidemal literals. Literal strings are usually either quoted (") or use an apostrophe (') which is often referred to as a single quote. Sometimes quotes are inaccurately referred to as double quotes.
Floating Point Literals
A floating point literal are numbers that have a decimal point or an exponential part. Some languages, such as Java, follow the IEEE 754 Binary Floating-Point Arithmetic standard.
Floating Point 'Equality' Problem
Because computers have trouble representing floating point values, you may want to reserve the use of floating point literals for imprecise measurements such length, height, weight, etc. The very nature of measurements is imprecise.