文章标题

来源:互联网 发布:剑网3数据非法 编辑:程序博客网 时间:2024/04/26 04:16

int:primitive原生态类型
Integer:一个对象
Java IntergerCache :(引用该网址内容http://javapapers.com/java/java-integer-cache/)
this is a feature introduced in Java 5 to save memory and improve the performance.
In Java 5, a new feature was introduced to save the memory and improve performance for Integer type objects handlings. Integer objects are cached internally and reused via the same referenced objects.
This is applicable for Integer values in range between –127 to +127 (Max Integer value).
This Integer caching works only on autoboxing. Integer objects will not be cached when they are built using the constructor.


以下是摘自tutorialspoint的内容:

collection class:a set of standard interfaces
Prior to Java 2, Java provided ad hoc classes such as Dictionary, Vector, Stack, and Properties to store and manipulate groups of objects. Although these classes were quite useful, they lacked a central, unifying theme. Thus, the way that you used Vector was different from the way that you used Properties.
The collections framework was designed to meet several goals:

  • The framework had to be high-performance. The implementations for the fundamental collections (dynamic arrays, linked lists, trees, and hashtables) are highly efficient.
  • The framework had to allow different types of collections to work in a similar manner and with a high degree of interoperability.
  • Extending and/or adapting a collection had to be easy.

查看源代码的方法:
在jdk中src.zip压缩包中有一些java的底层代码

0 0
原创粉丝点击