Array for keeping track of both uppercase and lowercase english alphabets
boolean [ ] uppercase = new boolean [ 26 ] ; boolean [ ] lowercase = new boolean [ 26 ] ; char [ ] arr = str . toCharArray ( ) ; for ( char c : arr ) { if ( Character . isLowerCase ( c ) ) lowercase = true ; if ( Character . isUpperCase ( c ) ) uppercase = true ; }