Online Java Compiler By
JavaTpoint.com
public class JavaCharcaterisJavaIdentifierPartExample_2 { 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 = ':'; ch2 = '\u0013'; ch3 = '\u0765'; // Create three boolean primitives b1, b2 and b3. boolean b1, b2,b3; // Assign isJavaCharacterIdentifierPart results of ch1, ch2 and ch3 to b1, b2 and b3. b1 = Character.isJavaIdentifierPart(ch1); b2 = Character.isJavaIdentifierPart(ch2); b3 = Character.isJavaIdentifierPart(ch3); String str1 = "The first character is a part of java identifier: " + b1; String str2 = "The second character is a part of java identifier: " + b2; String str3 = "The third character is a part of java identifier: " + b3; // Print the values of b1, b2 and b3. System.out.println( str1 ); System.out.println( str2 ); System.out.println( str3 ); } }
Output