java.lang.Character isAlphabetic(int codePoint)
Description
A character is considered to be alphabetic if its general category type, provided by getType(codePoint), is any of the following:
- UPPERCASE_LETTER
- LOWERCASE_LETTER
- TITLECASE_LETTER
- MODIFIER_LETTER
- OTHER_LETTER
- LETTER_NUMBER
or it has contributory property Other_Alphabetic as defined by the Unicode Standard.
The isAlphabetic(int codePoint) method of Character class is static thus it should be accessed statically which means the we would be calling this method in this format:
Character.isAlphabetic(int codePoint)
Non static method is usually called by just declaring method_name(argument) however in this case since the method is static, it should be called by appending the class name as suffix. We will be encountering a compilation problem if we call the java isAlphabetic() method non statically.
Method Syntax
public static boolean isAlphabetic(int codePoint)
Method Argument
Data Type | Parameter | Description |
---|---|---|
int | codePoint | the character (Unicode code point) to be tested. |
Method Returns
TheisAlphabetic(int codePoint) method of Character class returns true if the character is a Unicode alphabet character, false otherwise.
Compatibility
Requires Java 1.7 and up
Java Character isAlphabetic(int codePoint) Example
Below is a simple java example on the usage of isAlphabetic(int codePoint) method of Character class.
package com.javatutorialhq.java.examples; /* * This example source code demonstrates the use of * isAlphabetic(int codePoint) method of Character class. */ public class CharacterIsAlphabeticExample { public static void main(String[] args) { // initialize a codepoint int codepoint = 89; // check if the codepoint is an alphabet boolean checkBool = Character.isAlphabetic(codepoint); // print result if(checkBool){ System.out.print("Codepoint '"+codepoint+"' is an alphabet"); } else{ System.out.print("Codepoint '"+codepoint+"' is not an alphabet"); } } }
Sample Output
Below is the sample output when you run the above example.