After thinking for a while about the keywords 'this' and 'super' I concluded that they both refer to the same location in memory. To test this out I wrote the folowing code:
public class Test {
public static void main(String[] args){
B b = new B();
System.out.print(b.test());
}
}
class A{
public A(){
}
}
class B extends A{
public B(){
}
public boolean test(){
return (super.equals(this));
}
}
After running this program, the consoleOutput reads: 'true', so my idea seems to be right. Can someone agree with this?
A second question is why the same doesn't work when I change "super.equals(this)" by "this.equals(super)" or by "super==this" or by "this==super". Shouldn't 'equals' be symmetrical?