String str = "Hello, World!"; int codePoint = str.codePointAt(4); System.out.println("Code Point at index 4 is: " + codePoint);
char[] chars = {'\u0048', '\u0065', '\u006c', '\u006c', '\u006f'}; int codePoint = Character.codePointAt(chars, 0); System.out.println("Code Point at index 0 is: " + codePoint);In this example, an array of Unicode characters is created and the codePointAt() method is used to retrieve the code point of the character at the index 0. The output would be "Code Point at index 0 is: 72". Overall, the codePointAt() method is a useful tool for working with Unicode characters in Java.