A constant value in a program is denoted as literal. e.g.,
10, 534, 29.5, 'c', true, false, 'E', '&' are all literals of various datatypes.
int num = 10; 10 is an integer literal. Because the value 10 directly represents the integer so, 10 is called integer literal.
In Java, these are the various types of literals:
|