Table of Contents
Literal (computer programming)
See
Intro
“In computer science, a literal is a notation for representing a fixed Value (computer science) | value in source code. Almost all programming languages have notations for atomic values such as integer (computer science) | integers, floating-point numbers, and string (computer science) | strings, and usually for Boolean datatype | booleans and Character (computing) | characters; some also have notations for enumerated type | elements of enumerated types and compound values such as Array data structure | arrays, record (computer science) | records, and object (computer science) | objects. An anonymous function is a literal for the function type.”
“In contrast to literals, Variable (programming) | variables or constant (computer science) | constants are symbols that can take on one of a class of fixed values, the constant being constrained not to change. Literals are often used to initialize variables, for example, in the following, 1 is an integer literal and the three letter string in “cat” is a string literal:
<source lang=java>
int a = 1; string s = "cat";</source>
See also
See also
- Here document – a file literal or stream literal