zoukankan      html  css  js  c++  java
  • ByteCache

     private static class ByteCache {
            private ByteCache(){}
        //256个元素,用于缓存-128到127
            static final Byte cache[] = new Byte[-(-128) + 127 + 1];
    
            static {
                for(int i = 0; i < cache.length; i++)
                    cache[i] = new Byte((byte)(i - 128));
            }
        }
    

      Byte的valueof方法

      public static Byte valueOf(byte b) {
            final int offset = 128;
            return ByteCache.cache[(int)b + offset];
        }
    

      

  • 相关阅读:
    circle
    pq
    graph
    matrix
    计数(count)
    想象一下(imagine)
    出租车(taxi)
    字符串函数 (strfun)
    Sabota?
    3973: seq
  • 原文地址:https://www.cnblogs.com/shuiyonglewodezzzzz/p/6901759.html
Copyright © 2011-2022 走看看