Online Java Compiler By
JavaTpoint.com
public class JavaCharacterIsLowSurrogateExample2 { public static void main(String[] args) { // Create four char primitives ch1, ch2, ch3 and ch4. char ch1, ch2, ch3, ch4; // Assign the values to ch1, ch2, ch3 and ch4. ch1 = '*'; ch2 = 'a'; ch3 = 'Y'; ch4 = '#'; // Create four boolean primitives b1, b2, b3 and b4. boolean b1, b2, b3, b4; b1 = Character.isLowSurrogate(ch1); b2 = Character.isLowSurrogate(ch2); b3 = Character.isLowSurrogate(ch3); b4 = Character.isLowSurrogate(ch4); 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; String str4 = "The fourth character '"+ch4+ "' is a Unicode low-surrogate: " + b4; //Print the values of b1, b2, b3 and b4. System.out.println( str1 ); System.out.println( str2 ); System.out.println( str3 ); System.out.println( str4 ); } }
Output