this and super are two special keywords in Java, which is used to represent current instance of a class and it's super class. Java Programmers often confused between them and not very familiar with there special properties, which is asked at various core Java interviews. A couple of questions, which I remember about this and super keyword is that, Can we reassign this in Java? and the difference between this and super keyword in Java. Do you want to try that? Ok, I am not giving the answer now, rather I will let you know the answer at the end of this post. As I said in the first line, the main difference between this and super in Java is that this represents current instance of a class, while super represent current instance of the parent class. Now where does this and super variables used, well you might have seen examples of calling one constructor from other i.e. constructor chaining, that's achieved by using this and super keyword?
In this article, I am revisiting a couple of interesting question related to the internal working of HashMap in Java, mostly asked senior Java developers, ranging from 4 to 6 and up to 8 years of experience. I did cover lot of these questions from HashMap, ranging from thread-safety to race conditions, in my post about internal working of Java HashMap, but I thought to revisit two of those questions, How get method of HashMap or Hashtable works internally in Java and What happens if two different keys return the same hashCode, how do you return value from HashMap in that case. These are the question, which is highly popular in investment banking domain, and preferred choice of interviewer, while interviewing experienced Java professional.