DictionaryliteralFixed value in code
noun

literal

A fixed value written directly in source code.

The number 42 is a literal in this line of code.

Etymology

Literal means concerned with what is written directly. In programming, a literal states its value explicitly in the code instead of obtaining it through a named variable or calculation.

More examples

  • This assignment uses a string literal to store the greeting.
  • Replace the repeated literal with a named constant.
  • The Boolean literal false turns off this option.

Forms

literal · literals

Similar words

constant
Usually names a fixed value rather than writing it directly.