Suppose that we have next situation:
Parent class A:
class A{ public A(){} public doSomething(){ System.out.println(this.getCla
this doesn't do anything for you in this situtaion. Calling this.getClass() is no different than just calling getClass();
this
this.getClass()
getClass();
So, A calls getClass(), which will return B if you are dealing with an instance of B that extends A.