Character.isSupplementaryCodePoint() Method in Java
The java.lang.Character.isSupplementaryCodePoint(int codePoint) is an inbuilt method in java that determines whether the specified character (Unicode code point) is in the supplementary character range.
Syntax:
public static boolean isSupplementaryCodePoint(int codePoint)
Parameters: The codePoint of integer type refers to the character (Unicode code point) that is to be tested.
Return Value: This method returns true if the specified code point is between MIN_SUPPLEMENTARY_CODE_POINT and MAX_CODE_POINT inclusive, false otherwise.
Below programs illustrate the Character.isSupplementaryCodePoint() method:
Program 1:
// Code to illustrate the isSupplementaryCodePoint() method import java.lang.*; public class gfg { public static void main(String[] args) { // Create 2 int primitives c1, c2 and assign values int c1 = 0x10ffd, c2 = 0x154ca; boolean bool1 = Character.isSupplementaryCodePoint(c1); boolean bool2 = Character.isSupplementaryCodePoint(c2); String str1 = "c1 represents a supplementary code point is " + bool1; String str2 = "c2 represents a supplementary code point is " + bool2; // Displaying the result System.out.println(str1); System.out.println(str2); } } |
c1 represents a supplementary code point is true c2 represents a supplementary code point is true
Program 2:
// Code to illustrate the isSupplementaryCodePoint() method import java.lang.*; public class gfg { public static void main(String[] args) { // Creates 2 int primitives c1, c2 and assign values int c1 = 0x45ffd, c2 = 0x004ca; boolean bool1 = Character.isSupplementaryCodePoint(c1); boolean bool2 = Character.isSupplementaryCodePoint(c2); String str1 = "c1 represents a supplementary code point is " + bool1; String str2 = "c2 represents a supplementary code point is " + bool2; // Displaying the result System.out.println(str1); System.out.println(str2); } } |
c1 represents a supplementary code point is true c2 represents a supplementary code point is false
Reference: https://docs.oracle.com/javase/7/docs/api/java/lang/Character.html#isSupplementaryCodePoint(int)
Recommended Posts:
- Java lang.Long.numberOfTrailingZeros() method in Java with Examples
- Java.lang.Short toString() method in Java with Examples
- Java lang.Long.numberOfLeadingZeros() method in Java with Examples
- Java lang.Long.byteValue() method in Java with Examples
- Java.util.Collections.disjoint() Method in java with Examples
- Java lang.Long.reverse() method in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java.util.Collections.rotate() Method in Java with Examples
- Java lang.Long.builtcount() method in Java with Examples
- Java lang.Long.lowestOneBit() method in Java with Examples
- Java.util.ArrayList.addall() method in Java
- Java.math.BigInteger.modInverse() method in Java
- Java.math.BigInteger.probablePrime() method in Java
- Java Clock withZone() method in Java with Examples
- Java Clock tickMinutes() method in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



