Character.isAlphabetic() in Java

Character.isAlphabetic(): This method is available in java.lang.Character class of Java.

Syntax:

boolean java.lang.Character.isAlphabetic(int codePoint)

This method takes one argument of type int as its parameter. This method determines if the specified character (Unicode code point) is alphabetic.

Parameters: One parameter is required for this method.

codePoint: the character (Unicode code point) to be tested.

Returns: true if the character is a Unicode alphabet character, false otherwise.

Exceptions: NA

Approach

Java

public class CharacterisAlphabetic {
    public static void main(String[] args) {

        int codePoint = 'a';
        System.out.println(Character.isAlphabetic(codePoint));
    }
}

Output:

true

No comments:

Post a Comment