java.lang.Character isSupplementaryCodePoint(int codePoint)
Description
The isSupplementaryCodePoint(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.isSupplementaryCodePoint(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 isSupplementaryCodePoint() method non statically.
Method Syntax
public static boolean isSupplementaryCodePoint(int codePoint)
Method Argument
Data Type | Parameter | Description |
---|---|---|
int | codePoint | the character (Unicode code point) to be tested |
Method Returns
The isSupplementaryCodePoint(int codePoint) method of Character class returns true if the specified code point is between MIN_SUPPLEMENTARY_CODE_POINT and MAX_CODE_POINT inclusive; false otherwise.
Compatibility
Requires Java 1.5 and up
Java Character isSupplementaryCodePoint(int codePoint) Example
Below is a simple java example on the usage of isSupplementaryCodePoint(int codePoint) method of Character class.
package com.javatutorialhq.java.examples; /* * This example source code demonstrates the use of * isSupplementaryCodePoint(int codePoint) method of Character class. */ public class CharacterIsSupplementaryCodePointExample { public static void main(String[] args) { // initialize codepoints int codepoint1 = 12; int codepoint2 = 75492; // check the codepoints if it is in the supplementary character range boolean result1 = Character.isSupplementaryCodePoint(codepoint1); boolean result2 = Character.isSupplementaryCodePoint(codepoint2); // print the result System.out.println("Is codepoint "+codepoint1 + " is in the supplementary character range?"+result1); System.out.println("Is codepoint "+codepoint2 + " is in the supplementary character range?"+result2); // for readers reference // print the range of supplementary codepoint System.out.println("Minimum Supplementary codepoint:" + Character.MIN_SUPPLEMENTARY_CODE_POINT); System.out.println("Maximum Supplementary codepoint:" + Character.MAX_CODE_POINT); } }
Sample Output
Below is the sample output when you run the above example.