string literal

noun
UK /ˈstrɪŋ ˈlɪtərəl/
US /ˈstrɪŋ ˈlɪtərəl/

A string literal is a piece of text written right in the code, like a word or sentence inside quotes.

In the code print("Hello, world!"), the text "Hello, world!" is a string literal.


OTHER MEANINGS

2. In programming, a fixed sequence of characters enclosed in quotation marks that the computer treats as data, not as a command.

The compiler stores the string literal "error" in the program's memory.

3. A value written directly in source code rather than computed at runtime.

Assigning name = "Alice" uses a string literal to set the variable.

4. A text value that cannot be changed after it is created in some programming languages.

In Java, a string literal like "hello" is immutable.