Skip to main content

Character Sets

Java supports a wide range of characters as per Unicode, and these can be grouped into common character sets or character classes:

Here’s a clean table showing character categories and their examples in Java:

CategoryExamples
AlphabetsA–Z, a–z (e.g., A, B, x, z)
Digits0–9 (e.g., 0, 1, 5, 9)
Special Characters!, @, #, $, %, ^, &, *, (, ), -, +, etc.
Whitespace CharactersSpace (' '), Tab (\t), Newline (\n), Carriage Return (\r)