Mar Java Mit Java Blog

How to Implement a LRU Cache 0

How to Implement a LRU Cache

Typically LRU cache is implemented using a doubly linked list and a hash map. Doubly Linked List is used to store list of pages with most recently used page at the start of the...

How to fetch facebook reactions for posts 0

How to fetch facebook reactions for posts

Facebook reactions were introduced by Facebook last year. Prior to that you could only like Facebook posts. But after introductions of reactions, you react to a given post in 6 different ways. Fetching likes...

How much memory does a string consume in Java 0

How much memory does a string consume in Java

Understanding String memory usage To understand the above calculation, we need to start by looking at the fields on a String object. A String contains the following: a char array— thus a separate object—...