惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
S
Schneier on Security
博客园 - 【当耐特】
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MongoDB | Blog
MongoDB | Blog
NISL@THU
NISL@THU
N
Netflix TechBlog - Medium
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
月光博客
月光博客
T
The Exploit Database - CXSecurity.com
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
Recent Announcements
Recent Announcements
IT之家
IT之家
B
Blog
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Troy Hunt's Blog
O
OpenAI News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
V2EX - 技术
V2EX - 技术
L
Lohrmann on Cybersecurity
C
Cyber Attacks, Cyber Crime and Cyber Security
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Last Week in AI
Last Week in AI
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
A
About on SuperTechFans
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Engineering at Meta
Engineering at Meta
T
Threat Research - Cisco Blogs
Vercel News
Vercel News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Recorded Future
Recorded Future
C
Cisco Blogs
Project Zero
Project Zero

博客园 - 空气

没有不可能的事情 迅景如梭,旧游似梦,烟水程何限 [转]一些web开发中常用的、做成cs文件的js代码 数类 MBTI职业性格测试 Which Programming Lanuguage Are You? 如何解释内存中的内容 好久没来了。。。 第七章: 封装 - 空气 - 博客园 C/C++中的内存管理 经典正则表达式 二叉树的显示 软件工厂的考试题目程序 第六章: 字符串 测试-通过Word 2007发布Blog 第五章: 数组 第三章: 语法入门 1. 让自己习惯C++ 0. 序
第四章: 从 autoboxing 和 unboxing 认识对象
空气 · 2006-12-04 · via 博客园 - 空气

虽然C++是面向对象的编程语言,但它却是没有装箱和拆箱操作的.C语言就更没有了.C#中有,但用到的很少,只是学习C#的时候才接触了一点点,所以我对装箱和拆箱操作知之甚少.

在使用JAVA语言时,几乎都是在处理对象.而在JESE5.0之前,基本数据类型默认并不是以对象的形式存在,使用者必须亲自将之打包为对象,然后才能像对象一样操作它.从J3SE5.0开始为基本的数据类型提供了自动装箱,拆箱的功能,基本暑假类型转换为对象时更为方便.

打包基本数据类型:
int data = 10;
Integer dataWrapper = new Integer(data);

自动装箱和拆箱
装箱
Integer data1 = 10;

int i = 10;
Ineger integer = i;

拆箱
Integer fooInteger = 10;
int fooPrimitive = fooInteger;
或进行隐式的拆箱操作
Integer i = 10;
System.outprintln(i+10);

网络资源
Java 自动装箱支持
http://jcp.org/aboutJava/communityprocess/jsr/tiger/autoboxing.html
自动装箱(Autoboxing)
http://java.sun.com/j2se/1.5.0/docs/guide/languag/autoboxing.html