`
wei1.z
  • 浏览: 3836 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
HashMap HashMap 也是我们使用非常多的 Collection,它是基于哈希表的 Map 接口的实现,以 key-value 的形式存在。在 HashMap 中,key-value 总是会当做一个整体来处理,系统会根据 hash 算法来来计算 key-value 的存储位置,我们总是可以通过 key 快速地存、取 value。下面就来分析 HashMap 的存取。 一、定义 HashMap 实现了 Map 接口,继承 AbstractMap。其中 Map 接口定义了键映射到值的规则,而 AbstractMap 类提供 Map 接口的骨干实现,以最大限度地减少实现此接口所需的工 ...
Integer的源码   /*  * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.  */   package java.lang;   import java.util.Properties;   /**  * The {@code Integer} class wraps a value of t ...
来自于JDK version 1.0.79   /*  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.  *  */   package java.util; import java.io.*;   /**  * Hash table based implementation of the <tt>Map< ...
1、在写代码的过程中,偶尔使用到了 [java] view plain copy print? Integer.highestOneBit(i)  这个函数调用。使用的第一感觉就是这个函数是干什么用的,通过查看文档得知,这个函数的作用是取 i 这个数的二进制形式最左边的最高一位且 ...
本篇文章讲解了计算机的原码, 反码和补码. 并且进行了深入探求了为何要使用反码和补码, 以及更进一步的论证了为何可以用反码, 补码的加法计算原码的减法. 论证部分如有不对的地方请各位牛人帮忙指正! 希望本文对大家学习 ...
问一个基本的问题。 负数在计算机中如何表示? 举例来说,+8在计算机中表示为二进制的1000,那么-8怎么表示呢? 很容易想到,可以将一个二进制位(bit)专门规定为符号位,它等于0时就表示正数,等于1时就表示负数。比如, ...
1, http://blog.csdn.net/v_JULY_v/article/details/6256463#comments
key elements: underlying array and a hash function when you want to insert an object and its key, the hash function maps the key to an integer, which indicates the index in the array. The object is then stored at that index. Implementation one: extremely large array, the result of the function can ...
Global site tag (gtag.js) - Google Analytics