Javatpoint Logo
Javatpoint Logo

Java Character isValidCodePoint() Method

The isValidCodePoint(int codePoint) method of Character class determines whether the given(or specified) character is a valid Unicode code point or not.

Syntax

Parameter

The above method requires only one parameter:

a.) The codePoint which is the character that needs to be tested.

Return Value

The isValidCodePoint(int codePoint) method returns a Boolean value, i.e., true if the given(or specified) character lies in the range between MIN_CODE_POINT and MAX_CODE_POINT. Otherwise, this method returns false.

Example 1

Test it Now

Output:

The codePoint '12' is a valid codepoint : true
The codePoint '51' is a valid codepoint : true
The codePoint '121' is a valid codepoint : true
The codePoint '160' is a valid codepoint : true

Example 2

Test it Now

Output:

The first codePoint '121' is a valid codePoint :true
The second codePoint '128' is a valid codePoint :true
The third codePoint '227' is a valid codePoint  :true
The fourth codePoint '342' is a valid codePoint :true

Example 3

Test it Now

Output:

The first codePoint '323' is a valid codePoint :true
The second codePoint '345' is a valid codePoint :true
The third codePoint '564' is a valid codePoint :true
The fourth codePoint '787' is a valid codePoint :true
Next TopicJava Character




Help Others, Please Share

facebook twitter pinterest