Online Java Compiler By
JavaTpoint.com
public class CharactercharCountMethodExample2 { public static void main(String[] args) { // Case 1: codePoint is less than 0X10000. It will return 1. int a = Character.charCount(50); System.out.println("The value comes to be:"); System.out.println(a); // Case 2: codePoint is equal to 0X10000. It will return 2. int b = Character.charCount(589); System.out.println("The value comes to be:"); System.out.println(b); // Case 3: codePoint is greater than 0X10000. It will return 2. int c = Character.charCount(67890); System.out.println("The value comes to be:"); System.out.println(c); } }
Output