Common methods of Java Integer and Character classes

Common methods of the Integer class

Integer.MAX_VALUE method returns the maximum value

Integer.MIN_VALUE method returns the minimum value

public class Integer_Character {
    public static void main(String[] args) {
        System.out.println(Integer.MAX_VALUE);//返回最大值
        System.out.println(Integer.MIN_VALUE);//返回最小值
    }
}

 output display

 Common methods of the Character class

The Character.isDigit method determines whether it is a number

The Character.isLetter method determines whether it is a letter

The Character.isUpperCase method determines whether it is uppercase

The Character.isLowerCase method determines whether it is lowercase

The Character.isWhitespace method determines whether it is a space

The Character.toUpperCase method converts characters to uppercase

The Character.toLowerCase method converts characters to lowercase

public class Integer_Character {
    public static void main(String[] args) {
        System.out.println(Character.isDigit('a'));//判断是不是数字
        System.out.println(Character.isLetter('a'));//判断是不是字母
        System.out.println(Character.isUpperCase('a'));//判断是不是大写
        System.out.println(Character.isLowerCase('a'));//判断是不是小写

        System.out.println(Character.isWhitespace('a'));//判断是不是空格
        System.out.println(Character.toUpperCase('a'));//转成大写
        System.out.println(Character.toLowerCase('A'));//转成小写
    }
}

output display

 

Guess you like

Origin blog.csdn.net/henry594xiaoli/article/details/126771687