编辑代码

class Main {
	public static void main(String[] args) {
    //测试int类型强制类型转换成byte类型。
	byte a = 10;
    byte b = 20;
    int c = a+b;
    int t = 10;
    byte d =(byte)(c+10);
    //测试char类型和short类型之间的转换。
    char cc = 'a';
    short  nb = 11;
    char vb = (char)nb;
    short bbi = (short)vb;
    System.out.println(bbi);
    //测试整数类型和小数类型的转换。
    int ct = 10;
    double cr = ct+10.9D;
    System.out.println(cr);
    int ca = (int)cr;
    System.out.println(ca);
    long aa = 100;
    float bbv = aa;
    System.out.println(bbv);
    //测试自动转换类型。
    //
    int aaf = ct+nb+cc;
    System.out.println(aaf);




    }
}