摘要: 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 MXi4oyu 阅读(332) 评论(0) 推荐(0) 编辑