欢迎光临散文网 会员登陆 & 注册

风哥oracle数据库2022

2023-07-26 19:06 作者:hr122710  | 我要投稿

10.基本类型的包装类


把基本类型当做对象来使用

byte – Byte

short – Short

int – Integer

long – Long

float – Float

double – Double

char – Character

boolean – Boolean


1. 数字父类Number

子类:Byte,Short,Integer,Long,Float,Double,BigDecimal,BigInteger

取出基本类型值的方法

byteValue(),shortValue(),intValue(),longValue(),floatValue(),doubleValu()

2. Intger类

创建Integer对象: a= { value:6}

Integer a = new Integer(6);

Integer a = Integer.valueOf(6);

Integer 类中存在256个Integer缓存对象,封装-127到128;如果访问指定范围内的值,会访问缓存对象,如果超出范围,会新建对象。


风哥oracle数据库2022的评论 (共 条)

分享到微博请遵守国家法律