Java Character isAlphabetic() Method
Example
Check if characters are alphabetic:
public class Main {
public static void main(String[] args) {
System.out.println(Character.isAlphabetic('A'));
System.out.println(Character.isAlphabetic('z'));
System.out.println(Character.isAlphabetic('9'));
}
}
Definition and Usage
The isAlphabetic() method checks if a character is alphabetic. It returns true for letters, and false for digits, spaces and symbols.
It is almost the same as isLetter(). The difference is that it also returns true for a few special characters that work like letters, for example the Roman numeral characters in Unicode (the standard list that gives every character a number).
Syntax
public static boolean isAlphabetic(int codePoint)
The parameter is a code point (the number that Unicode gives each character). You can also pass a char, like 'A', because Java converts it to an int for you.
Parameter Values
| Parameter | Description |
|---|---|
| codePoint | Required. The character to check, as a code point. |
Technical Details
| Returns: | true if the character is alphabetic, otherwise false. |
|---|
Related Pages
❮ Character Methods