package com.lovecoding.day11.baozhuang02;

public class Test02 {

    public static void main(String[] args) {
        //把基本数据类型转为字符串
        int i1 = 10;
        //String s1= i1; // 编译错误
        String s = String.valueOf(i1);
        //+号连接
        String s1 = i1 + "";

        //把字符串转为基本数据类型
        //数字 字面值必须是数字 "123" 基本  "aaafdas123"转int  //NumberFormatException
        String s2 = "123";
        //包装类的的方法
        int i = Integer.parseInt(s2);
        System.out.println(i);


        //字符串转为包装类
        Integer integer = Integer.valueOf(s2);

        //最大值
        int maxValue = Integer.MAX_VALUE;
        System.out.println(maxValue);

        byte maxValue1 = Byte.MAX_VALUE;
        System.out.println(maxValue1);


        //比较的方法
        int compare = Integer.compare(12, 12);
        System.out.println(compare);
        int compare1 = Integer.compare(11, 12);
        System.out.println(compare1);
        int compare2 = Integer.compare(13, 12);
        System.out.println(compare2);

        //compare 0 相等  - 小   + 大
    }
}
