In the above example the literal is 2.
The term literal is not something of .Net or even computing, it is a basic mathematical term.
Literal can be said, roughly speaking, since it is difficult to understand, such as a fixed value .
It exists to determine values. The most common is that these values are numbers. Many of these numbers may have a suffix indicated by their type, or they may have prefixes indicating whether the notation is different from the decimal (hexadecimal, binary, and octal are common). Another literal as well is what represents a text, a string , or even just a character. true
and false
are usually boolean type literals.
Some languages have other literals. Some even allow you to create a literal, albeit rare.
The literal is always constant, but a constant does not have to be represented by a literal . Many people use the term improperly for the literal. Although the literal is constant, it can be assigned to variables, the literal will never change, but the value of the variable may change.