Java Data Type Tutorial - Java Character .isValidCodePoint (int codePoint)








Syntax

Character.isValidCodePoint(int codePoint) has the following syntax.

public static boolean isValidCodePoint(int codePoint)

Example

In the following code shows how to use Character.isValidCodePoint(int codePoint) method.

public class Main {
   public static void main(String[] args) {
      int cp1 = 0x0123, cp2 = 0x123fff;
/*  www .j a va  2s  .c  o  m*/
      boolean b1 = Character.isValidCodePoint(cp1);
      boolean b2 = Character.isValidCodePoint(cp2);

      System.out.println( b1 );
      System.out.println( b2 );
   }
}

The code above generates the following result.