Character.UnicodeBlock.of() char in Java

Character.UnicodeBlock.of(): This method is available in java.lang.Character.UnicodeBock of Java.

Syntax:

UnicodeBlock java.lang.Character.UnicodeBlock.of(char c)

This method takes one argument of type char as its parameter. This method returns the object representing the Unicode block containing the given character, or null if the character is not a member of a defined block.

Parameters: One parameter is required for this method.

c: The character in question.

Returns: The UnicodeBlock instance representing the Unicode block of which this character is a member or null if the character is not a member of any Unicode block.

Exceptions: NA

Approach

Java

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

        char c = 'a';
        System.out.println(Character.UnicodeBlock.of(c));

    }
}

Output:

BASIC_LATIN


No comments:

Post a Comment