Woodstock Blog

a tech blog for general algorithmic interview questions

[Fundamental] What Is a Literal?


A Literal) is a notation for representing a fixed value in source code.

Almost all programming languages have notations for atomic values such as integers, floating-point numbers, and strings.


int a = 1;
String s = "cat";

Integer literal

an integer literal is an integer whose value is directly represented in source code.