Clear or evict all cache Programmatically.
Does Java provide something which can clear all the cache at once?👆👆👆👆❓❓❓
The answer is NO 👎👎👎😕😕😕.
Java does not provide any such feature which can clear all the cache at once.👍👍👍👍
So how do clear all the cache?😞😞😞
We have a solution which we can use to achieve this,😀😄✌👌
CacheManager class has a method name getCacheNames() returns the name of the cache, and after that we use clear() to clear that cache.
we use this method to achieve our goal to clear all the cache.
Find the code below 👇👇👇👍