literal_computer_programming

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>

Fair Use Source: Literal (computer programming)

See also

See also

Categories

literal_computer_programming.txt · Last modified: 2025/02/01 06:43 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki