public class Aanum {public static void main (string[] args) {String s = new String ("12hma&% $k #d_34h3ah"); int max = 0;int Min = 0;int other = 0;for (int i = 0;i < S.length (); i++) {if (S.charat (i) >= ' A ' &&s.charat (i) <= ' Z ') {max++;} else if (S.charat (i) >= ' a ' &&s.charat (i) <= ' z ') {min++;} elseother++;} System.out.println ("Max:" +max+ "\nmin:" +min+ "\nother:" +other); max = 0;min = 0;other = 0;for (int i = 0;i < S.length (); i+ +) {if (Character.isuppercase (S.charat (i)) = = True) {max++;} else if (Character.islowercase (S.charat (i) = = true) {min++;} elseother++;} System.out.println ("Max:" +max+ "\nmin:" +min+ "\nother:" +other); max = 0;min = 0;other = 0; String SL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String SU = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0;i < S.length (); i++) {if (Sl.indexof (S.charat (i))! =-1) {max++;} else if (Su.indexof (S.charat (i))! =-1) {min++;} elseother++;} System.out.println ("Max:" +max+ "\nmin:" +min+ "\nother:" +other);}} Reproduced in
Qing Ling Medium
How to determine the case of letters (3 kinds)