Online Java Compiler By
JavaTpoint.com
public class JavaCharacterIsLowSurrogateExample1 { public static void main(String[] args) { // Create three char primitives ch1, ch2 and ch3. char ch1, ch2, ch3; // Assign the values to ch1, ch2 and ch3. ch1 = '\udc34'; ch2 = 'a'; ch3 = 'Y'; // Create three boolean primitives b1, b2 and b3. boolean b1, b2, b3; b1 = Character.isLowSurrogate(ch1); b2 = Character.isLowSurrogate(ch2); b3 = Character.isLowSurrogate(ch3); String str1 = "The first character '"+ch1 + "' is a Unicode low-surrogate: " + b1; String str2 = "The second character '"+ch2 + "' is a Unicode low-surrogate: " + b2; String str3 = "The third character '"+ch3 + "' is a Unicode low-surrogate: " + b3; // Print the values of b1, b2 and b3. System.out.println( str1 ); System.out.println( str2 ); System.out.println( str3 ); } }
Output