包装类里关于八种基本数据类型的装箱 与 拆箱

public class firstClass {

public static void main(String[] args) {

//包装类 装拆箱

//byte

//装

Byte num1= 5;

System.out.println(num1);

//拆

byte num2 = num1;

System.out.println(num2);

//char

//装

Character num3= 'A';

System.out.println(num3);

//拆

char num4= num3;

System.out.println(num4);

//short

Short num5= 5;

System.out.println(num5);

//拆

short num6 = num5;

System.out.println(num6);

//boolean

//装

Boolean a = true;

System.out.println(a);

//拆

boolean b = a;

System.out.println(b);

//int

//装

Integer a1= 10;

System.out.println(a1);

//拆

int b1=a1;

System.out.println(b1);

//long

//装

Long a2 = 20L;

System.out.println(a2);

//拆

long b2 = a2;

System.out.println(b2);

//float

//装

Float a3 =3.1F;

System.out.println(a3);

//拆

float b3 = a3;

System.out.println(b3);

//double

//装

Double a4 =3.14D;

System.out.println(a4);

//拆

double b4 =a4;

System.out.println(b4);

}

}

你可能感兴趣的:(java,jvm,算法)