浅谈wrapper类是什么
1.wrapper单词含义wrapper单词的含义是封装,包装的意思2.wrapper类是什么wrapper类就是包装类(也叫封装类)如:IntegerLongFloatDouble叫它包装是因为你在声明时只需如:int a=2;long b=4;float c=3.4f;double d=6.32;而不需要用到包装类,如:Integer a=new Integer(2);Long b=new L
·
1.wrapper单词含义
wrapper单词的含义是封装,包装的意思
2.wrapper类是什么
wrapper类就是包装类(也叫封装类)如:
Integer
Long
Float
Double
叫它包装是因为你在声明时只需如:
int a=2;
long b=4;
float c=3.4f;
double d=6.32;
而不需要用到包装类,如:
Integer a=new Integer(2);
Long b=new Long(4);
Float c=new Float(3.4f);
Double d=new Double(6.32);
就是说包装类把一些原始的东西都包装起来,我们用的时候就不需要直接使用它们,这样可简化代码工作。
更多推荐
已为社区贡献1条内容
所有评论(0)