https://www.javacodegeeks.com/2014/03/how-hashmap-works-in-java.html Most common interview questions are “How HashMap works in java”, “How get and put method of HashMap work internally”. Here I am trying to explain internal functionality with an ea…
缓存淘汰算法 在高并发.高性能的质量要求不断提高时,我们首先会想到的就是利用缓存予以应对. 第一次请求时把计算好的结果存放在缓存中,下次遇到同样的请求时,把之前保存在缓存中的数据直接拿来使用. 但是,缓存的空间一般都是有限,不可能把所有的结果全部保存下来.那么,当缓存空间全部被占满再有新的数据需要被保存,就要决定删除原来的哪些数据.如何做这样决定需要使用缓存淘汰算法. 常用的缓存淘汰算法有:FIFO.LRU.LFU,下面我们就逐一介绍一下. FIFO FIFO,First In First Ou…
https://www.javainterviewpoint.com/hashmap-works-internally-java/ How a HashMap Works internally has become a popular question in almost all the interview. As almost everybody knows how to use a HashMap or the difference between HashMap and Hashtable…