How does Java determine whether a string is an eight-bit alphabetic character?

public static void main(String[] args) {

System.out.println("Please enter an eight-digit string:");

Scanner scanner = new Scanner(System.in);

String str = scanner.nextLine();

//Determine whether the string is eight digits

if(str.length() != 8){

System.out.println("String is not eight digits");

return;

}

char [] c =str.toCharArray();

for (char c1 : c) {

//Determine whether c is an alphabetic character , the front LowerCase is lowercase, and the back UpperCase is uppercase, it returns True, otherwise it returns False

if(!Character.isLowerCase(c1) && !Character.isUpperCase(c1)){

System.out.println("String contains non-alphabetic characters!");

return;

}

}

}