package cn.usts.edu.fly.packingClass;/** * @author:fly*@description:包装类:* java中有8大基本数据类型,但是没有属性和和方法,于是jdk出现了包装类* byte Byte char Char int Integer short Short* long Long float Float double Double boolean Boolean**自动装箱*基本类型--->包装类型* int --> Integer 自动装箱***自动拆箱*基本类型<---包装类型* int <-- Integer 自动拆箱*** valueOf:返回的是个包装类* parseInt:返回的就是基本数据类型*@date :2021/10/3116:15*/publicclass PackingDemo {publicstaticvoidmain(String[] args){String a ="123";int i =Integer.parseInt(a);// 把string类型转换为int类型System.out.println(i+1);int b =456;System.out.println(123+String.valueOf(b)+"789");// int转换为字符串}}