Recently I stumble on one of the Java interview questions: “Implement List-Recently-Used (LRU) Cache using Java collection class?” If you have worked on similar problem before, then it is really easy for you. Otherwise you start thinking about the best collection class to implement LRU cache. Most of the people fail to recognize that LinkedHashMap […]

,

There are two methods hashCode() and equals() present in Object class which are important and should be implemented in class. A Java developer should know the basic concept behind these methods. And sometimes even in technical interview questions are asked related to these. This get more important when object is used in hash based Collection […]

, , ,

In many programming job interview this question has been asked. If you are coming from Python programming background(or you are novice Java programmer) then definitely “==” operator will pop-up in your mind. But in Java, “==” may not give you the right result. equals() method is also used to compare the object. Operator “==” and […]

,