49

java基础(八) 深入解析常量池与装拆箱机制-life is beautiful

 6 years ago
source link: http://blog.51cto.com/sihai/2104686
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
引言  本文将介绍常量池与装箱拆箱机制,之所以将两者合在一起介绍,是因为网上不少文章在谈到常量池时,将包装类的缓存机制,java常量池,不加区别地混在一起讨论,更有甚者完全将这两者视为一个整体,给初学者带来不少困扰,我就是过来的。同时,也因为包装类的缓存与字符串常量池的思想是一样的,很容易混淆,但是实现方式是不一样的。一、常量池在介绍常量池前,先来介绍一下常量、字面常量、符号常量的定义。常量可分为

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK