1. View.findViewById采用深度遍历,找到第一个匹配的控件
  2. Integer Cache
         public static void testIntegerCache() {
    Class cache = Integer.class.getDeclaredClasses()[0];
    try {
    Field f = cache.getDeclaredField("cache");
    f.setAccessible(true);
    Integer[] array = (Integer[]) f.get(cache);
    array[130] = array[131];
    } catch (Exception e) {
    e.printStackTrace();
    }
    System.out.printf("1+1=%d", 1+1);
    }
  3. 上面关键在于Integer.valueOf()方法
         public static Integer valueOf(int i) {
    if(i >= -128 && i <= IntegerCache.high)
    return IntegerCache.cache[i + 128];
    else
    return new Integer(i);
    }

Integer cache的更多相关文章

  1. Java Integer Cache

    Java Integer Cache Java 代码 public class IntegerDemo { public static void main(String[] args) { Integ ...

  2. Integer Cache(带你脱坑)

    Integer Cache 废话不多说----->直接上代码: public class IntegerDemo { public static void main(String[] args) ...

  3. Integer与int的区别

    简述:int与Integer的区别: 对于它们,我们可能只是知道简单的区别.Integer是int的一个封装类,int的初始值为0,而Integer的初始值为null.但是他们之间真的仅仅只有这些区别 ...

  4. 【转】理解Java Integer的缓存策略

    本文将介绍 Java 中 Integer 缓存的相关知识.这是 Java 5 中引入的一个有助于节省内存.提高性能的特性.首先看一个使用 Integer 的示例代码,展示了 Integer 的缓存行为 ...

  5. Java Integer(-128~127)值的==和equals比较产生的思考

    最近在项目中遇到一个问题,两个值相同的Integer型值进行==比较时,发现Integer其中的一些奥秘,顺便也复习一下==和equals的区别,先通过Damo代码解释如下: System.out.p ...

  6. 一道Integer面试题引发的对Integer的探究

    面试题: //在jdk1.5的环境下,有如下4条语句: Integer i01 = 59; int i02 = 59; Integer i03 =Integer.valueOf(59); Intege ...

  7. Integer 中的缓存类IntegerCache

    2014年去某公司笔试的时候遇到这么一道题: public class Test { public static void main(String[] args) { Integer int1 = I ...

  8. 理解Java Integer的缓存策略

    转载自http://www.importnew.com/18884.html 本文将介绍 Java 中 Integer 缓存的相关知识.这是 Java 5 中引入的一个有助于节省内存.提高性能的特性. ...

  9. java integer对象判断两个数字是否相等

    java integer对象判断两个数字是否相等,不一定对 问题发生的背景:javaweb的项目,起先,因为在java中实体类中的int类型在对象初始化之后会给int类型的数据默认赋值为0,这样在很多 ...

随机推荐

  1. 股票自用指标 boll 菜刀

    BI:=(H+L+O+C)/; BOL:EMA(BI,N); UPPER:BOLL+N1*STD(CLOSE,N); LOWER:BOLL-N1*STD(CLOSE,N); MA1:MA(CLOSE, ...

  2. 获取网页URL地址及参数等的两种方法(js和C#)

    转:获取网页URL地址及参数等的两种方法(js和C#) 一 js 先看一个示例 用javascript获取url网址信息 <script type="text/javascript&q ...

  3. 在VS 2010中使用 VS2013的解决方案

    本文转载自:http://blog.csdn.net/u011543589/article/details/25563351 今天要用VS2010打开VS2013,一直觉得VS2010到VS2012只 ...

  4. Redis系统管理相关指令简介

    常用命令列表 DBSIZE                                            返回当前数据库 Key 的数量 INFO                       ...

  5. 使用水晶报表更新后出现“值不能为 null。 参数名: inputString”

    简单记录一下: 如果更新完水晶报表相关页面可能在原来页面刷新会出现错误:"值不能为 null. 参数名: inputString",如图:

  6. 解决AD域认证问题—“未知的身份验证机制”

    场景: Ad认证登录系统,之前正常.不知服务器调了什么,导致无法登录.提示信息如标题. 解决方案: DirectoryEntry adRoot = new DirectoryEntry("L ...

  7. SqlServer统计最近一周的数据

    select * from 表名 where  DATEDIFF( day, 日期字段列名,getdate())<7 and DATEPART(w,  日期字段列名) <DATEPART( ...

  8. Tomcat插件与Jetty插件在MyEclipse中的配置

    -Djetty.port=8101 jetty:run tomcat6:run <plugin> <groupId>org.apache.tomcat.maven</gr ...

  9. DBA_Oracle Erp中某个Form需进行升级Patch详解(案例)

    2014-06-21 Created By BaoXinjian

  10. Educational Codeforces Round 15 Powers of Two

    Powers of Two 题意: 让求ai+aj=2的x次幂的数有几对,且i < j. 题解: 首先要知道,排完序对答案是没有影响的,比如样例7 1一对,和1 7一对是样的,所以就可以排序之后 ...