design an lru cache in java?



design an lru cache in java?..

Answer / Shabd Prakash

LRU Cache can be designed using a LinkedHashMap where the access order is maintained. When the size limit is reached, the least recently used item is removed from the cache.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why we use multi threading instead of multiprocessing?

1 Answers  


What is the indent key?

1 Answers  


Explain about map interface in java?

1 Answers  


long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) then?

3 Answers  


Differences between jdk 1.4 and 1.5

6 Answers   SoftSol, TCS, Wipro,


Why put method is used?

1 Answers  


Can size_t be negative?

1 Answers  


what is the difference between cd & dvd ?

30 Answers   Lovely Professional University, Satyam, Sibylsys,


What is polymorphism java example?

1 Answers  


What is the difference between jdk and jre?

1 Answers  


why interaction with server using javascript is difficult

1 Answers  


How do singleton patterns work?

1 Answers  


Categories