<< 移位运算

    /**
     * The maximum capacity, used if a higher value is implicitly specified
     * by either of the constructors with arguments.
     * MUST be a power of two <= 1<<30.
     */
    static final int MAXIMUM_CAPACITY = 1 << 30;

为什么用移位运算?

1. 得到的一定是偶数

2. 简洁 (上面例子中如果直接赋int值是 1073741824 ,没有意义的一组数字,不好记,太可怕)

3. 控制位数 (int 是32位)

原文地址:https://www.cnblogs.com/zno2/p/5610913.html