1、基本数据类型的包装类
是基本数据类型的引用类型,提供基本数据类型的数据转换和数据操作的方法。
byte ->Byte
short ->Short
int ->Integer
long ->Long
boolean ->Boolean
float ->Float
double ->Double
char ->Character
实现基本数据类型和引用类型之间的转换
自动装箱 将基本数据类型的数据封装为基本数据类型的包装类
自动拆箱 将基本数据类型的包装类拆封为基本数据类型的数据
2、String字符串类型
是不可变类,并且是一个引用类型。
--创建String类型的对象 :
String item = "hello";
或者
String item = new String("hello");
方法:
charAt(int index) ;-- 返回指定索引处的 char 值:
indexOf(int ch) ;--返回指定字符在此字符串中第一次出现处的索引:
lastIndexO