java基本类型与包装类相互转换
基本类型int i=100转换成包装类对象方法两种
1.new Integer(i)包装类的构造方法俗称手动装箱
2.Integer a=i基本数据类型直接赋值包装类对象俗称自动装箱
包装类型拆箱基本数据类型两种方法
1.Integer.intValue()手动拆箱
2.int
i=Integer对象自动拆箱.
基本数据类型怎么转换成字符串三种方法
基本数据类型
空串
String.ValueOf()
Integer.toString()
字符串变基本数据类型两种方法
String.parseInt()
基本类型int i=100转换成包装类对象方法两种
1.new Integer(i)包装类的构造方法俗称手动装箱
2.Integer a=i基本数据类型直接赋值包装类对象俗称自动装箱
包装类型拆箱基本数据类型两种方法
1.Integer.intValue()手动拆箱
i=Integer对象自动拆箱.
基本数据类型怎么转换成字符串三种方法
基本数据类型
String.ValueOf()
Integer.toString()
字符串变基本数据类型两种方法
String.parseInt()