代码如下:
public static void main(String[] args) {
String str = "AaFsECvcS12483fs+-*/";
int big=0;
int small=0;
int number=0;
for (int i = 0;i<str.length();i++) {
//提取每一个字符的值
char c = str.charAt(i);
//每一个进行判断比较
if(c>='a'&&c<='z') {
small++;
}else if(c >= 'A' && c <= 'Z') {
big++;
}else {
number++;
}
}
System.out.println("字符串大写字母有"+big+"个,小写字母有"+small+"个,数字字符有"+number+"个");
}