使用阿里云代码规范插件扫描后出现以下提示: hashmap should set a size when initalizing,即hashmap应该在初始化时设置一个大小 在网上搜到一篇讲解(https://www.cnblogs.com/coderxuyang/p/3718856.html),如下: 在元素的装载数量明确的时候HashMap的大小应该如何选择. 今天看到美团招聘给出了一道小题目,关于HashMap的性能问题.问题如下: java hashmap,如果确定只装载100个元素,n
今天上午在CSDN的论坛里看到有朋友提的问题如下: /** @param maxSize Maximum sum of the sizes of the Bitmaps in this cache */ public LruMemoryCache(int maxSize) { if (maxSize <= 0) { throw new IllegalArgumentException("maxSize <= 0"); } this.maxSize = maxSize; th