More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. We can use an expiration map whose entries gets expired after a certain interval and then we can put the logic to retrieve the entries if its expired in map.
Alternatively we can create a separate class and make map its element. We can refresh the map in this class periodically by using a monitoring thread within static block.
Help us improve. Please let us know the company, where you were asked this question :