isLowerCase:判断是否小写,Char类型
isUpperCase:判断是否大写,Char类型
toUpperCase:输出大写,String类型
toLowerCase:输出小写,String类型
public class Test2 {
public static void main(String[] args){
char Char1='A',Char2='a';
System.out.println( Character.isUpperCase(Char1));
System.out.println( Character.isUpperCase(Char2));
//查询是否大写
System.out.println( Character.isLowerCase(Char1));
System.out.println( Character.isLowerCase(Char2));
//查询是否小写
String Str1="Hello world!";
System.out.println(Str1.toUpperCase());
//输出大写字母
System.out.println(Str1.toLowerCase());
//输出小写字母
}
/*运行结果如下:
true
false
false
true
HELLO WORLD!
hello world!
*/