Check for All Uppercase/Lowercase in Java
Using Standard JDK
public static boolean isUpperCase(String s) {
for (int i = 0; i < s.length(); i++) {
if (Character.isLowerCase(s.charAt(i)))
return false;
}
return true;
}
NOTE: There are also alternatives using Apache Commons or Guava libraries, but they may run into issues when the string contains punctuations/other symbols.