package com.lovcoding.day01;

public interface Test03_YinShi {

    public static void main(String[] args) {
        //byte  -> short  (char )-> int -> long -> float ->double  从小到大。

        byte b = 127;
        int i = b;
        System.out.println(i);

        int i1 = 123456;

        float f1 = i1;
        System.out.println(f1); //提升到浮点加上 .0

        byte b1 = 120;
        double d1 = b1;
        System.out.println(d1);

        //byte short  char
        byte b2 = 127;
        short s2 = b2; //byte 可以转化为 short

        //byte char 不能转化
        byte b3 = 12;
        // char c3 = b3;

        //char 和 short
        short s4 = 128;
        //char c4 = s4;

        //总结  char 和 byte 和 short 不能 转化 byte和short可以转化

        //char 和 int
        char c5 = 'A'; //char 存储的ANSII 码   一个字符 对应的 数字
        int i5 = c5;
        System.out.println(i5); //65 = A   a = 97

        //short int
        short s6 = 128;
        int i6 = s6;

        // byte + byte 运算
        byte b7 = 126;
        byte b8 = 1;

        //byte b9 = b7+b8; // 不能操作

        byte b11 = 12;
        short s11 = 12;

        //  s111 = b11 + s11;
        // char short byte 之间不能直接操作 必须通过 int

        int a = 1;
        int b111 = 2;
        double result = a/b111;
        System.out.println(result);

    }
}
