Number类

2016-01-19  本文已影响0人  浅巷墨漓丶
public class OverClass{
    public static void main(String[] args) {
        Integer a = new Integer(100);
        Integer b = new Integer(1000);
        int ab = a*b;

        String[] str = {"12","1231","32451"};
        int sum = 0;
        for (int i = 0;i < str.length ; i++) {
            int m = Integer.parseInt(str[i]);
            sum = sum-m;
            System.out.println(sum);
        }
        System.out.println(sum);

        String age = Integer.toString(123);
        System.out.println(age);

        int max = Integer.MAX_VALUE;
        int min = Integer.MAX_VALUE;
        int intSize = Integer.SIZE;
        System.out.println(max);
        // System.out.println(min);
        // System.out.println(intSize);

        int result = a.compareTo(b);
        if (result == -1) {
            System.out.println("a比b小");
        }

        boolean resultB = a.equals(b);
        if (resultB){
            System.out.println("相等");
        }else {
            System.out.println("不等");
        }

        Character char1 = new Character('a');
        Character char2 = new Character('A');
        System.out.println(Character.isUpperCase(char1));   // 判断是否为大写
        System.out.println(Character.isLowerCase(char1));   // 判断是否为小写
        System.out.println(Character.isWhitespace(char2));  // 判断是否为空格
    }
}
上一篇下一篇

猜你喜欢

热点阅读