In Java, literals represent constant values directly written into the code. They are of several types:
1. **Integer Literals**: Represent integer values.
- Example: `int x = 100;`
2. **Floating-Point Literals**: Represent decimal values.
- Example: `double pi = 3.14159;`
3. **Character Literals**: Represent a single character enclosed in single quotes.
- Example: `char grade = 'A';`
4. **Boolean Literals**: Represent boolean values, either `true` or `false`.
- Example: `boolean isActive = true;`
Literals can also be used to represent other data types, such as string literals, which are enclosed in double quotes.