Literals are the actual values that are assigned to variables or constants. There are six types of literals:
- Boolean literals
- Character literals
- String literals
- Integral literals
- Floating literals
- null literal
Escape Sequence is a special notation which is used to represent some special characters which can’t be represented as it is.
|\’||Single quote character|
|\”||Double quote character|
ASCII Character Sets
- ASCII stands for American Standard Code for Information Exchange.
- Every character enclosed in a single quotation mark will have an integer equivalent value called as ASCII value. Range of ASCII value is 0-255.
UNICODE Character Sets
- UNICODE is the Unicode Worldwide Character Standard. It contains many diverse characters. Each character must have a UNICODE value.
- Syntax: \uXXXX, where X will be a hexadecimal number.
- Range: 0 to 65535
Every country has its own character representation in an integer value. United States has ASCII, Europe has ISO 8859-1, Russia has KOI-8, etc. So, it was thought to create a character set that contains all the characters. There UNICODE came into play.