public class Schar {
public static void main(String[] args) {
String s = "fdAH67%_k.";
int m = 0,k = 0,n = 0;
for(int i = 0;i < s.length();i++) {
char c = s.charAt(i);
if(c >= "a" && c <= "z") {
m++;
}else if(c >= "A" && c <= "Z") {
k++;
}else {
n++;
}
}
System.out.println(m+" "+k+" "+n);
}
}
------解决方案--------------------------------------------------------
字符使用单引号,你在if/else if里使用字符和字符串比较