Online Java Compiler By
JavaTpoint.com
public class JavaCharacterisHighSurrogateExample2 { public static void main(String args[]) { //Initialize two char value char a1 ='Z'; char a2 ='z'; //Create two object obj1 and obj2. Character obj1 =new Character(a1); Character obj2 =new Character(a2); //Check whether the given charactesr 'obj' and 'obj2' are isHighSurrogate or not. boolean b1 = obj1.isHighSurrogate(a1); boolean b2 = obj2.isHighSurrogate(a2); //Print the values. System.err.println("The character 'Z' is a Unicode high-surrogate code unit: "+b1); System.err.println("The character 'z' is a Unicode high-surrogate code unit: "+b2); } }
Output