Online Java Compiler By
JavaTpoint.com
public class CharactercodePointCountMethodExample2 { public static void main(String[] args) { System.out.println("The alphabets are: 'a', 'b', 'c', 'd', 'e'"); char[] c1 = new char[] { 'a', 'b', 'c', 'd', 'e' }; int offset1 = 0, count1 = 4; int res1 = Character.codePointCount(c1, offset1, count1); System.out.println("The number of Unicode code point for alphabets are " + res1); System.out.println("The numbers are: '1', '2', '3', '4', '5'"); char[] c2 = new char[] { '1', '2', '3', '4', '5' }; int offset2 = 1, count2 = 3; int res2 = Character.codePointCount(c2, offset2, count2); System.out.println("The number of Unicode code point for numbers are " + res2); } }
Output