String str = "example123"; for (int i = 0; i < str.length(); i++) { if (Character.isJavaIdentifierPart(str.charAt(i))) { System.out.println(str.charAt(i) + " is a valid Java identifier part."); } else { System.out.println(str.charAt(i) + " is not a valid Java identifier part."); } }This code will output "e is a valid Java identifier part." for each letter in "example123" because all letters can be used in Java identifiers. It will also output "1 is not a valid Java identifier part." because numbers cannot be used as the first character in Java identifiers. The Character class is part of the Java standard library, specifically the java.lang package.