练习1判断字符大小写
package yinshifuxi;
public class Demo2 {
public static void main(String[] args) {
char ch = 'a';
if (Character.isUpperCase(ch)) {
System.out.println("字符:" + ch + "是大写字符");
} else {
System.out.println("字符:" + ch + "是小写字符");
}
}
}
结果是 :字符:a是小写字符
网友评论