package com.myclass.basicDataType;
//基本数据类型
public class BasicDataTypeAndClassPackage {
public static void main(String[] args) {
char a = 'a'; //包装类 Character a
byte b = 12; //包装类 Byte b
short c = 22; //包装类 Short c
int d = 34; //包装类 Integer d
long f = 45L; //包装类 Long f
float g = 23.4f; //包装类 Float g
double h = 34.5; //包装类 Double h
boolean i = true; //包装类 Boolean i
//1、各个数据类型之间的运算转换
//一般都是隐式转换,小的与大的一起运算,往大的数据类型转
int aa = a+d;
float dd = f+g;
double ff = h+g;
int bb = a+b;
System.out.println(aa);
System.out.println(dd);
System.out.println(ff);
System.out.println(bb);
//自动装箱与拆箱
Integer v = 12;
short vv = 23;
int vvv = v+vv;
System.out.println(vvv);
}
}