摘要: JDK的源码,看看到Integer.ValueOf(int)里面做了什么优化:public static Integer valueOf(int i) { final int offset = 128; if (i >= -128 && i <= 127) { // must cache return IntegerCache.cache[i + offset]; } return new Integer(i);} private static class IntegerCache { private IntegerCache(){} static final In 阅读全文
posted @ 2010-02-22 17:00 zhwj184 阅读(234) 评论(0) 推荐(0) 编辑