Literals are used to represent a fixed value; there are multiple types of literals that are used; they are as follows:
- Integer literals
- String literals
- Hexadecimal literals
- Address literals
Integer literals are formed with a sequence of numbers from 0 to 9. Octal literals and ones starting with 0 are invalid, since the addresses in Ethereum start with 0. Take a look at this:
int a = 11;
String literals are declared with a pair of double("...") or single('...') quotes, for example:
Test = 'Batman';
Test2 = "Batman";
Hexadecimal literals are prefixed with the keyword hex and are enclosed with double (hex"69ed75") or single (hex'69ed75') quotes.
Hexadecimal literals that pass the address checksum test are of address type literal, for example:
0xe2793a1b9a149253341cA268057a9EFA42965F83;
0x126B3adF2556C7e8B4C3197035D0E4cbec1dBa83;