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:
Category | Examples |
---|---|
Alphabets | A–Z , a–z (e.g., A , B , x , z ) |
Digits | 0–9 (e.g., 0 , 1 , 5 , 9 ) |
Special Characters | ! , @ , # , $ , % , ^ , & , * , ( , ) , - , + , etc. |
Whitespace Characters | Space (' ' ), Tab (\t ), Newline (\n ), Carriage Return (\r ) |